Monday, March 25, 2013

UML Refresher

Here is a quick UML refresher for class diagrams.

  1. Inheritance is indicated by a solid line with a closed, unfilled arrowhead pointing at the super class
  2. dotted line with a closed, unfilled arrow means implementation of the interface it is pointing to
  3. A bi-directional association is indicated by a solid line between the two classes. At either end of the line, you place a role name and a multiplicity value.
  4. A uni-directional association is drawn as a solid line with an open arrowhead pointing to the known class.  In a uni-directional association, two classes are related, but only one class knows that the relationship exists.
  5. A basic aggregation relationship indicates that one class is a part of another class. In an aggregation relationship, the child class instance can outlive its parent class. To represent an aggregation relationship, you draw a solid line from the parent class to the part class, and draw an unfilled diamond shape on the parent class's association end.
  6. A composition aggregation relationship is just another form of the aggregation relationship, but the child class's instance lifecycle is dependent on the parent class's instance lifecycle. The composition relationship is drawn like the aggregation relationship, but this time the diamond shape is filled.
  7. Attributes/operations visibility: +/public, #/protected, -/private, ~/package.
Reference

No comments: