Enterprise Architect Tips & Tricks

Experienced users of Enterprise Architect will have learned (and may have even shared) tips and tricks to help them be even more productive when using the tool. You may already be aware of the publication “Fifty Enterprise Architect Tricks” by Peter Domen which has been published on the Enterprise Architect forum.

Adding attributes & operations to classes “gotcha”

When modelling classes in Enterprise Architect, there will be a time when your classes need to be populated with attributes and/or operations.

The dialogs for both attributes and operations exhibit the annoying behaviour that upon saving the details of either an attribute or an operation, the dialog fields are
not cleared (as they are in other dialogs). As shown below:

Now, when we click Save the dialog now looks like:

The dialog fields have not been cleared.

This can be perceived both as an inconsistency and a cause of annoyance. How many times have you thought you were adding a new attribute or operation only to find you have overwritten the one just created? I know I have.

It is tedious to click Save followed by New so is there a better way? Well, instead of clicking
Save followed by New you could click Save followed by
Copy which is a very productive way of adding lots of similar attributes (those with the same type for example), but less useful for operations.

Many Enterprise Architect users puzzle as to why the Save action does not clear the dialog (as in other dialogs) and wish that this was indeed the behaviour of Enterprise Architect.

Although I cannot state why Enterprise Architect behaves in this manner, it is possible to change the behaviour of saving Attributes or Operation details such that the dialog does indeed clear, ready for the next entry.

Changing the Save behaviour when adding an attribute or operation

The solution has been there all the time! But finding it needs a bit of detective work.

  • Open Enterprise Architect’s Options dialog, by selecting
    Tools | Options… from the main menu
  • Click on Attributes/Operations to view the options as below

  • Clear the check-box labelled After save, re-select edited item

Yes, it really is that simple!

Now, let’s add another attribute using our changed options and see the difference.

Now, after clicking Save, the dialog fields are cleared (as we would expect) ready the next attribute

Although not illustrated, the option also works for the operations dialog.

Conclusion

In this newsletter we have shared a useful tip in Enterprise Architect which will make your use of the tool much more productive when designing classes. I hope, like me, your reaction is “If only I had found this earlier!”

Previous Next
0 comments