220 likes | 337 Views
UML Class Diagrams (more notation). Class Diagrams. Used for static modeling, i.e. modeling the static aspects of system Design class diagram (DCD) – used in design model, incorporates more detail than class diagram used for domain model. Fig. 16.2. Attributes. How to show: Attribute text
E N D
Class Diagrams • Used for static modeling, i.e. modeling the static aspects of system • Design class diagram (DCD) – used in design model, incorporates more detail than class diagram used for domain model
Attributes • How to show: • Attribute text • Association line labeled • Attribute text notation: name : type Use +/- for visibility of attribute
Attribute as association • Association line (in design model): • Navigability arrow • Multiplicity • Role name • No association name
Attributes Guideline: use attribute text for data type objects, use association lines for more substantial objects . . .
Dependencies • Dependency relationship: client object has knowledge of other object • Dependency line used in UML to show: • Global visibility • Parameter variable • Local variable • Static method
Composition • Two closely related concepts: • Aggregation – part/whole • Composition – stronger form of part/whole (Note: for our purposes we will not make the distinction and just refer to it as composition.) • Notation: • Use (closed) diamond • Do not label association
Qualified Association • Qualified association • Provide a name for one end of an association • Usually reduces multiplicity from many to one • Names an item within a context to show uniqueness • Example: File – Directory: use a filename as a qualifier
Association Class • Association class • Allows attributes that more naturally belong to association than to either class • Example: Company – Person with association Employs, Salary more naturally belongs to association than to either of classes