Problem Analysis  «Prev  Next»
Lesson 6 Review class diagram notation review, part 1
ObjectiveReview the Class Diagram Notation

Review the Class Diagram Notation

Classes are modeled using
  1. a single rectangular shape with
  2. three internal compartments: name, attribute, and operation.

Name compartment

The name compartment holds 1) the class name, 2) an optional stereotype, and 3)optional properties. The name is located in the center of the compartment. The stereotype (<< >>) may be used to limit the role of the class in the model, and is placed at the top of the compartment. Common examples of class stereotypes include <<Factory>>, based on the Factory design pattern, and <<Interface>>, for Java interfaces or for user interfaces.
Properties use the constraint notation and are placed in the bottom-right corner of the compartment. Properties are basically constraints, used to clarify intent in defining the model element. Properties can be used to document the status of a class under development or for designations such as abstract and concrete.

Name compartment

Attribute compartment

The attribute compartment simply lists the attributes of the class using the notation you learned previously.
The list order does not matter.

Attribute compartment

Operation compartment

Likewise, operations are listed in the operation compartment using the notation you learned in the first course in this series.
Operation compartment

The completed class definition can be shown either as the entire class definition with all three compartments visible or as just the name compartment.

  1. Name compartment
  2. Attribute compartment
  3. Operation compartment
  4. Class name
  5. Properties
  6. Stereotype

Click on the link below to see the three parts of the class diagram notation.
Completed Class Definition