Abstract
In this post we’ll see how to use EA to draw a basic class diagram quickly and with easy. In the end of this post you should be able to start working with EA as a reverse engineering tool and as a UML drawer. The added values of this are:
- The ability to draw UML faster then a board + marker / paper and a pen.
- Reusability of UML / designs (in contrast to Visio / paper / board drawing, reason: elements change over multi-drawing >> update maintenance that EA solves).
Quick start guide
Getting started
Downloading EA (Enterprise Architect)
- http://www.sparxsystems.com/products/ea/trial.html
- Professional version is usually good enough for software engineers.
Importing your code
- Right click an empty class diagram folder, or, alternatively – create a new class diagram folder (see Creating a New Diagram),
- Click ‘Code Engineering’ >> Import Source Code
Inserting an existing entity
I found that there are two ways to do the job:
- Right click the canvas, select “Insert Existing Element”.
- A tip I found here: http://www.sparxsystems.in/blog/enterprise-architect-tips-compilation1/
Tip #2: Insert Existing Element Draw connector to a model Element One can insert an existing model element and establish a relationship while drawing a new connector Follow usual steps to draw a connector, but press “Shift” before choosing the type of relationship to be created, this will invoke the “Select Existing Element” dialog to choose a model element instead of creating a new element.
Relating an entity to an existing entity
Right-click on element >> Insert Related Elements Read more here…
Prettifying the view
Feature Visibility
You can set a collection of options to display or hide the features of that element on a specific diagram.
- Select the class element
- Right mouse click >> “Feature and compartment visibility (Ctrl+Shift+Y)”
- Disable attributes and operations accordingly.
Auto-size elements
After you shrink the size of the elements using Feature Visibility, you can auto-size the element to take minimal space. To Auto-Size select the wanted elements and press Alt+Z
Define how features are displayed on the diagram
In most cases you only need the class/entity name, some operation (without the parameters) and their return value and the relations between the entities, everything else detracts. To normalize the view:
- Select Menu >> Diagram >> Properties (F5)
- Select the wanted view behavior and press OK
Designing
Adding new entities
Adding new entity/class
Right click an empty space on the canvas and select ‘New element or connector’, select the wanted entity (usually a class). Name it and press OK. Read more here…
Adding related entity
If you select an element you’ll notice that on the right there is a ‘quick tools’ icons. Select the up arrow and drag it to an empty space on the canvas. Once released a menu will open, select the relation type while holding the shift, this will open a search for known entity.
Resources
Quick Start Guide
- http://pathfindersolns.com/wp-content/uploads/2012/01/Quick-Start-Guide-Enterprise.pdf
- http://www.sparxsystems.com/enterprise_architect_user_guide/9.3/index.html