he first part is about magentos setup/data install system.
Every module wants to do "things" in the system. Install new Attributes, create new tables, etc. Create products for special purpose, ...
All this can be done with the magento setup scripts. They are living in
I hope you know what community, local, Namespace and Modulname is, so I won't explain it.
Magento has two different types of setup scripts:
sql scripts are living in
sql and used to do changes to the database, like adding new columns, creating and dropping indexes, creating new attributes, etc. They run pretty early, especially before the store system is initialized
data scripts are living in
data and rund later, so you already know, that there are websites and stores exist.
In your example, the setupname would be
complexworld_setup, because this is the XML node name.
The names of the scripts are:
data scripts are prefixed with data, the sql scripts omit this prefix.
The setup scripts run in the context of the
<class> you sepcify, if you omit the class, the default is
Mage_Core_Model_Resource_Setup. You have to declare a class at least for changes to the different EAV types (customer, product, category, ...) and for changes to the no longer EAV types (quote, order, order_item, ...).
I still don't know exactly why this node exists. And what it is for. Rico Neitzel told me, that because all the config is merged in a big xml structure, you would later now know, which setup belongs to which module.
- Thanks, the penny has dropped.
In the context of the setup script you need to know the module, because otherwise magento has no idea, to update from which version to which version.
I hope this helps a bit to understand...