2. Domain Model Relationships
2
Domain Model
Use Case Model
Interaction Diagrams
Glossary
Design
Requirements
Business Model
Classes, attributes, associations
Domain
objects
Elaboration on some terms
3. A Domain Model
illustrates meaningful conceptual classes in a problem
domain.
is a representation of real-world concepts, not software
components.
is NOT a set of diagrams describing software classes, or
software objects and their responsibilities.
It may show:
concepts
associations between concepts
attributes of concepts
3
4. Domain Model: UML Notation
Illustrated using a set of class diagrams for
which no operations are defined.
4
A Domain Model is a
description of things in the real
world.
A Domain Model is not a
description of the software
design.
A concept is an idea,
thing, or object.
5. A Domain Model is not a Software
Artifact
A Conceptual class:
5
Sale
Date
Time
Sales Database
Sale
Date
Time
Print()
Software Artifacts:
vs.
6. Identify Conceptual Classes by Noun
Phrase:
Identify Nouns and Noun Phrases in
textual descriptions of the domain.
Fully dressed Use Cases are good for this
type of linguistic analysis.
It’s not strictly a mechanical process:
Words may be ambiguous
Different phrases may represent the same
concepts.
6
7. Steps to create a Domain Model
Identify Candidate Conceptual classes
Draw them in a Domain Model
Add associations necessary to record the
relationships that must be retained
Add attributes necessary for information
to be preserved
7
8. Apply the Mapmaker Strategy
Use existing names for things, the
vocabulary of the domain
Exclude irrelevant features
Do not add things that are not there
8
9. UML: Associations
VideoVideoStore Stocks
*1
association name multiplicity
-"direction reading arrow"
-it has no meaning except to indicate direction of
reading the association label
-optional
10. UML: Multiplicity
zero or more;
"many"
one or more
one to forty
exactly five
T
T
T
T
*
1..*
1..40
5
T
3, 5, 8 exactly three,
five or eight
Customer
Video
Rents
*
One instance of a
Customer may be
renting zero or more
Videos.
One instance of a Video
may be being rented by
zero or one Customers.
0..1
11. GUIDELINES: Associations
Only add associations for noteworthy relationships.
Literally, those for which making a “note” is worthy or
business motivated. Video
...Rents
Influenced-by
1
1..*
1 Loan Policy
...
Customer
...
Important association.
Need to remember.
Low value association.
Possible, but so what?
12. UML and GUIDELINES: Attributes
Show only “simple” relatively primitive types
as attributes.
Connections to other concepts are to be
represented as associations, not attributes.
Payment
date : Date
time : Time
amount : Money
attributes
13. A Common Mistake - Classes as
Attributes
Rule: If we do not think of a thing as a
number or text in the real world, then it is
probably a conceptual class.
If it takes up space, then it is likely a
conceptual class.
Examples:
A Store is not an attribute of a Sale
A Destination is not an attribute of a flight
13
14. Specification or Description Conceptual
Classes
A Class that records information about an
item.
Even if all Instances of the item are sold
out, the description remains.
Avoids duplication of recording the
descriptive information with each instance
of the item.
14
15. Description of a Service Example
(Flight)
15
Airport
Name
vs.
Flight
Date
Time
Number
Flight
Date
Time
Flight Desc
Date
Time
Airport
Name
Flies-to
Described
-by
Describes
-flights-to