Class diagram Lection №2
Plan Class: name, attributes, operations. Relationships between classes. Interfaces. Objects. Templates. Recommendations for the development of class diagram
Class
Class: visibility quantum “+” public type. “#“ protected type. "-“ private type.
Class: multiplicity [0..1] [0..*] [1..*] [1..5] [1..3, 5, 7] [1..3, ] [1..3,7..*]
Class color: Соlоr employee_name [1..2] : String visibility:Boolean form:Polygon
Class attributes color:Соlоr = (255, 0, 0) employee_name[1..2]:String = Ivan Ivanovich. visibility:Вооlеаn = true. form:Polygon = rectangle. visibility:Вооlеаn = truth.
Operations +create() +draw (form: Polygon = rectangle, fill_color Color: = (0, 0, 255)) ask_client’s_account (number_of_account:Integer):Сиггепсу show_message():{"division by zero Error"}
Dependency relationship
«access» «bind» «derive» «import» «refine»
Association
Aggregation
Composition
Generalization
Limits {complete} {disjoint} {incomplete} {overlapping}
Generalization
Interfaces
Objects
Template
Recommendations A well-structured class diagram Is focused on communicating one aspect of a system's static design view. Contains only elements that are essential to understanding that aspect. Provides detail consistent with its level of abstraction, with only those adornments that are essential to understanding. Is not so minimalist that it misinforms the reader about important semantics.
Recommendations When you draw a class diagram, Give it a name that communicates its purpose. Lay out its elements to minimize lines that cross. Organize its elements spatially so that things that are semantically close are laid out physically close. Use notes and color as visual cues to draw attention to important features of your diagram. Try not to show too many kinds of relationships. In general, one kind of relationship will tend to dominate each class diagram.