Lecture 8-Domain Model and Class Diagrams
Lecture 8-Domain Model and Class Diagrams
Domain Model
Class Diagram
DEPARTMENT OF COMPUTER
SCIENCE
FALL 2019
What is a Domain Model?
A domain model is a visual representation of conceptual
classes or real-world objects in a domain of interest.
In UML, a domain model is illustrated with a set of class
diagrams in which no operations/methods are defined.
Also known as Visual Dictionary
It shows:
conceptual classes (concepts / domain objects)
associations between conceptual classes
attributes of conceptual classes
DOMAIN MODELS DO NOT SHOW
SOFTWARE COMPONENTS
Sale
date
print()
A Domain Model is Conceptual class,
not a Software Artifact
Conceptual Class:
Software Artifacts:
Sale SalesDatabase
amt
vs. Sale
item
Double amt;
Item item;
What’s the void print()
difference?
CRITERIA FOR USEFUL
ASSOCIATIONS
Stocks
Store Item
1 *
association multiplicity
MULTIPLICITY
ATTRIBUTE
attributes
• It defines model elements such as classes, interfaces, and user-defined data types,
their internal structure, and their relationships to each other.
• Class attributes and their data types are identified here, as are the operations and
their return types.
Class Diagrams
• Class diagrams show the relationships among and details about each
class.
• Class diagrams are also the foundation for component and deployment
diagrams.
Note Symbols
Association
Multiplicity
Generalization
Aggregation and composition
Navigability
Constraints
Interfaces
Note Symbols
1..* 1
We can specify:
Lower Bound….Bound
is part of
Composition
– Composition is a stronger form of aggregation - a composite
aggregation - is shown by a black diamond-shaped arrowhead
– In composition association, the whole strongly owns its parts
– If the whole object is copied or deleted, its parts are copied or deleted
with it
– The multiplicity at the whole end of a composition association must be
1 or 0..1
– A part cannot be part of more than one whole by composition
29
Composition
Example
– The following diagram illustrates the difference between weak and
strong aggregations.
– An address book is made up of a multiplicity of contacts and contact
groups. A contact group is a virtual grouping of contacts; a contact may
be included in more than one contact group. If you delete an address
book, all the contacts and contact groups will be deleted too; if you
delete a contact group, no contacts will be deleted.
Association with no navigability