Lecture-05-DomainModel
Lecture-05-DomainModel
Domain Models
1
Why do this?
• If
you don’t understand the domain, you
• Lower
the representational gap between
mental model and software model
2
Objectives
3
What is a Domain Model?
• Illustrates
noteworthy concepts in a domain.
That, defines what the system is about
• Modelsthe things in your system and the
way they relate to each other
•A domain model is conceptual, not a
software artifact
•A visual dictionary
4
What’s the Difference?
5
Business Object Model
6
Domain Model, visually
8
How to Create a Domain
Model
10
Noun Phrase Identification
• Consider the following problem description, analyzed for Subjects, Verbs,
Objects:
The ATM verifies whether the customer's card number and PIN are correct.
S V O O O
If it is, then the customer can check the account balance, deposit cash, and withdraw
12
Where are the Terms?
• Some are in the use case
• Some come from domain experts
• Natural language is imprecise and ambiguous, so
13
POS example
You can create a list, or you can use a set of class diagrams, per the table
below
Product Product
Payment
Catalog Specification
14
Model
Monopoly Game Domain
16
Description Classes
• A description class contains information that
describes something else
• E. g. Product Description records the price, picture,
text description (and what else?) of an item
19
Associations (cont’d)
• Avoid having too many; this adds communication
paths and complexity
• Will they be implemented in software?
20
Associations (cont’d)
• Multiplicity: how many instances of
class A can be associated with an
instance of class B.
• E. g. an instance of Store can be
Sale
attributes
date
startTime : Time
22
Attribute Types
• Usually primitive data types, as well as things like
Color, DateTime, Zip code, etc. The latter are
specializations of primitive types
• It should not normally be a class, such as Sale or
23
New Data Type Classes
• Things like ItemID or ClaimNumber are not always
simple data types, even though they look like them
• If the attribute contains separable pieces, it can be
its own class. For example, a Claim Number has the
24
New Data Type Classes
(cont’d)
• If it has other attributes, such as a sale price
• If it has units, such as currency
• If it is an abstraction of one or more types with
25
Is the Domain Model
Correct?
• No, but it’s a good approximation
• It gets better with each iteration; don’t try to get it
all at once
26