Working with a builder class
Working with a builder class
29.10.2008 10:30
I make a builder class to generate my instances (like the DishwasherBuilder example). How can I change the order of the generated called class_Init() functions. Is it possible or depends the order on the alphabetic name?
Re: Working with a builder class
29.10.2008 15:40
Hi
you can try the property CG:CGGeneral:GeneratedCodeInBrowser.
Switching on and regnerate code.
Now you have some autogenerated operations visible in the browser =>initRelations for example is now part of your builder class.
You can edit this file (change order of init calls) and than switching off the property.
Now only the changed operation is part of the model.
Note: if you now add a new class to your builder class you had to add the init call manually to your initRelations or delete the operation and start again as descibed above.
Michael
Re: Working with a builder class
03.11.2008 11:18
Hi All
You can set the displayed order with either:
- In the Menu, View, Browser display Options, Enable Ordering
- In the Properties on the model level set the Property, Browser:Settings:ShowOrder to TRUE.
Unfortunately this does not influence the order of code generation. Rhapsody explicitly states that the order of model elements can never be related to the generated code. You should adapt your model in a way that the sequence of initialization is irrelevant.
greetingz
Walter
Re: Working with a builder class
03.11.2008 18:26
Hi
after a few discussions, we think that my first idea, works but is not a very useful solution. Maybe better will, not to use the Builder Solution here, and create the instances manually.

