If a picture is worth 1024 words then a well crafted UML diagram is worth 2048 words. UML diagrams help programmers explain software systems to other developers, project managers, and clients. This article proposes a process for learning UML, recommendations for drawing diagrams, and ways to refine diagrams over time.
Getting Started with UML
- If you are new to UML diagramming practice with paper or a whiteboard. Starting off with these mediums ensures you are learning one thing at a time. Tools like MS Visio are built to be user friendly but you will learn UML from the way Microsoft interprets UML. Even a fully UML compliant editor (such as Enterprise Architect) will increase your learning curve because every application interprets how you should draw UML differently. Learn UML first, then cool design software.
- Using design tools (like Visio or Enterprise Architect) to brainstorm wastes time; if the problem is not well understood or the solution changes – you must redraw the diagram. Use design tools to communicate “solutions to problems” or “problems”.
- Ask someone that is not a stakeholder in your project to interpret the diagram. Project stakeholders might make assumptions based on pre-existing project knowledge.
- Avoid spending extra time making diagrams UML compliant if they are tacit. I’ve spent hours arguing over a Use Case diagram arrangement – this time can be spent elsewhere. Compliance will improve over time, don’t try to make things perfect the first time.
- Use separate diagrams to describe different areas of a system. Mixing multiple diagram types into one diagram will confuse your audience.
Recommended Reading
- UML 2.0 In a Nutshell (O’Reilly) http://oreilly.com/catalog/9780596007959/
- Learning UML 2.0 (O’Reilly) http://oreilly.com/catalog/9780596009823
UML Style Guidelines
- Avoid curved lines
- Avoid overlapping lines. If lines must intersect use a “line jump” to indicate overlaps
- Elements should have consistent shapes and sizes. This includes decorations like rounded rectangle radius and line thickness
- Diagram elements should have consistent whitespace
- Maintain consistent fonts, colors, and font styles
- Use sans-serif fonts
Style Guideline References
http://www.ibm.com/developerworks/webservices/library/ws-tip-uml/
Refining UML Diagrams Over Time
- Create templates in your favorite design tool to reduce startup time
- Modify your diagrams based on feedback from clients and project managers. This may include items such as:
- Color coded elements accompanied by a color key
- Comments next to diagram elements
- Use layers to provide details for different audiences (this is a handy feature of Visio). Details may include:
- Comments or notes not intended for the client
- Developer details not relevant to designers
- User interface notes that don’t pertain to developers
Recommended Software
Microsoft Visio
http://office.microsoft.com/en-us/visio/default.aspx
Enterprise Architect
http://www.sparxsystems.com.au/
I would like to share one good UML Modeling Tool: http://www.magicdraw.com