How to model associations between Classes of different Moduls/Builder?
How to model associations between Classes of different Moduls/Builder?
10.02.2009 10:31
Hi,
in our project every developer has a builder for his module (e.g. HWD_Module, Appl1_Module, GUI_Module). At the end we put the modules together by instantiate the module-builders with an "OverAll"-Builder.
This works fine till the need of associations that are not in the module (e.g. a class of Appl1_Module has an association to a Class of HWD_Module). The current solution is to do this associations in the Init of the OverAllBuilder with the manual call of C_Appl1setItsC_HWD(...) to pass the me-pointer to C_Appl1.
Is there a way of modelling this associations / pass of the me-pointer?
Of course we can do a builder for the whole Target. But this won't be suitable for bigger projects. You will lost the Overview in this Builder and the developer which maintain this have the need to know more about the other moduls then necessary.
Re: How to model associations between Classes of different Moduls/Builder?
13.03.2009 09:40
Hi
Modules should, off course, not have internal classes that have associations with internal classes of other modules. I know that's the theory but I repeat it here because it is important that you should alwayas try to model in that way.
If this type of relations cannot be avoided, you should see that you group the relations in an interface class (Not an interface in the UML way but a normal class that builds an interface). You can make a Singleton out of that so that it is globally known or you can let the class register itself in a global variable (Which is actually the same)
I hope this helps you.
Thanks for writing to our forum!!
Kind regards
Walter
Re: How to model associations between Classes of different Moduls/Builder?
13.03.2009 13:17
Hi Walter,
That seems the best way and is easily to realize in our project. We still using selfmade interface classes to get hardly associations between the functional modules.
Thanks for your answer.
Greetz,
ph2nd

