Skip to content

Latest commit

 

History

History
90 lines (62 loc) · 2.89 KB

File metadata and controls

90 lines (62 loc) · 2.89 KB

This is the quick recap for UML knowledge.

Attribute

  • -: private
  • +: public
  • #: protected
  • ~: package/default

The name of the abstract class should be included in "<<>>" or in italics. The name of the abstract method should also be in italics.

For interface, "<< interface >>" should be shown and the name should be in italics as well.

Any method that is defined only, either abstract method or interface method, should be in italics.

classes

Relationship

Basic relationships:

  • Inheritance: solid line with hollow arrow
    • a full line with hollow/open arrow
    • the superclass is at the arrow end
    • a class is the generalization of other classes
    • example: Dog - Animal
  • Realization: dotted line with hollow arrow
    • a dashed line with hollow/open arrow
    • the interface is at the arrow end
    • a class is the definition of other classes
    • example: Plane - Flyable
  • Association: solid line
    • a full line without arrow
    • a full line with a solid or empty arrow is also association
    • a dashed line with an empty arrow is dependency (weaker, transient relationship)
    • a class is associated/depended with other class
    • example: Car - Road
  • Aggregation: solid line with hollow diamond
    • a full line with hollow/open diamond
    • the aggregation is at the diamond end
    • a class is a container or collection of other classes
    • example: Employee - Company
  • Composition: solid line with solid diamond
    • a full line with solid/closed diamond
    • the composition is at the diamond end
    • a class is a whole with other classes
    • example: Door - House

Illustrations:

  • B is the aggregation of A:

    aggregation

  • B is the composition of A:

    composition

  • B is the generalization of A:

    specialization/generalization

  • C is association with A and B:

    association

  • A is depended on B:

    dependended

  • A is associated with B:

    associated

Multiplicity

  • 0..1: zero to one (optional)
  • n: specific number
  • 0..*: zero to many
  • 1..*: one to many
  • m..n: specific number range

Reference