Working with a builder class

4021 Betrachtungen
Seite: 1
Cyman
avatar
Community Member
5 Beiträge

Working with a builder class

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?

MichaelKamsties
avatar
Administrator
75 Beiträge

Re: Working with a builder class

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

Walter
avatar
Moderator
29 Beiträge

Re: Working with a builder class

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

MichaelKamsties
avatar
Administrator
75 Beiträge

Re: Working with a builder class

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.

See manual initialize instances

Seite: 1

Currently Online:

There is nobody online.

Welcome to our latest member: lammils