模块互相编辑

I'm starting to look into how to make projects modulair, now I get the part that you can (for example) make a folder and put the module-files in there, which brings the following question:

How to go when you make a extension for both the core, and a module?

Example:

Let's say I have a module 'departments' and a module 'users', of which the module 'departments' forces the module 'users' to specify a department for each user, and also edits the new user creation form (to, obviously, also specify a department)

Any ideas on how to go with this, or any good tutorials on this?

Hope this clears out what I'm trying to figure out, my english on this isn't too good..

There's a very simple way to do this...

The "users" module needs to present open hooks for each step of it's process.. For example, when it's outputting the form, it needs to allow another module to hook in to that form and change it.

This way, the departments module can hook in to the form, add the new field, and also hook into the receiver and add handling for the new field.

It's up to your architecture how the hooking is done, of course, but you just need to allow a way for a module to create new hooks and, if you want, to specify it's dependencies. If a module can specify dependencies (departments is dependant on users), then you need to sort them before you include them in such a way that all the dependencies are met.