Tips & Tricks from Lars Olofsson, Sweden

Renaming state machines;

Want to change the state variable name? Simply rename it by clicking on the attribute on the class diagram. Press F2, and type the new name. Note that this doesn’t rename the state machine itself.

Avoid renaming the state machine State Attribute from the state machines property page, do that leads to strange results.

Want to rename the state machine? (i.e. change object name of the state machine itself)

Open the state diagram, click on the background, in the object inspector, select the Name attribute and edit it (avoid changing the State Attribute here)

I’ve changed my state machine, why are all these functions still in my class?

They are simple not state machine functions any more, but ECO does not remove them because you may have valuable stuff in there. Just remove them from the model by Ctrl+Delete –ing them, and clean any code fragments left behind from the class.

Maximizing modeling screen area

In VS2010 you can grab any tab and move it to another screen or just make it full screen after you detached it from it’s usual place. In this case, grab the modeling surface tab, move it to detach and then make it full screen. In Windows 7 push it to the top and it becomes full screen!

Setting a default class on a model

If you want an implicit superclass for all classes in a model, you actually do that change on the package level.

Open the model so that the “Modlr” tab is visible and contains information for the model in question.

Left click to select the package to you want to set the default Superclass on.

Then, without clicking anywhere else, select the “Properties” tab in VS and you will see the Package properties.

Drop down the list of classes and select which class you want as a superclass on the “Default Superclass” setting.

Note that you may want to the change the “TableMapping” property of the superclass. If you for example are adding attributes common to all classes in your model/package, you may want to child map that class to get those attributes on each table instead of in a separate table (a separate super class table will generate a lot on joins when retrieving objects)

Leave a Reply

Your email address will not be published. Required fields are marked *

*