Domain Model Refinement
Domain Model Refinement
Notation Extensions
Domain Classes
Unit - 5 : Define Model Refinement 3
Fig. 5.2 Alternate notation
Payment Payment
Payment
amount : Money
Payment
Payment
Pays-for Sale
amount : Money 1 1
But useful?
Male Female
Customer Customer
2
each payment subclass is Cash Credit Check
handled differently Payment Payment Payment
*
Identifies-credit-with Paid-with
1 1
CreditCard Check
*
superclass justified by AuthorizationService
common attributes and
associations address
name additional associations
phoneNumber 2
Credit Check
Authorization Authorization
Service Service
1 1
Authorizes Authorizes
* *
Credit Check
Payment Payment
Payment Payment
Too much middle Authorization Authorization
management? Reply Request
Each transaction is
handled differently, so
CreditPayment CreditPayment CheckPayment CheckPayment it is useful to partition
Approval Denial Approval Denial them into discrete
Reply Reply Reply Reply classes.
date
time
Payment Payment
Authorization Authorization
Reply Request
Payment
Payment is an abstract
conceptual class. A Payment
instance must conform to one
(b) CashPayment CreditPayment CheckPayment of the subclasses:
CashPayment, CreditPayment
or CheckPayment.
* Is-in 1
Payment PaymentState better
Unauthorized Authorized
State State
Store AuthorizationService
both placements of
address merchantID are incorrect address
merchantID because there may be more merchantID
name than one merchantID name
phoneNumber
Think: transaction ID
Purchases ServiceContract
3 Sells
1..* merchantID *
Think: transaction ID
AuthorizationService
Store
Authorizes-payments-via address
address 1..* name
name * phoneNumber
an association class
ServiceContract
its attributes are related to the association
merchantID
its lifetime is dependent on the association
Think: transaction ID
1 Incarcerates
Jail * Person
JailTerm
dateOfIncarceration
Married-to
0..1 0..1
Person
Sale SalesLineItem
1 1..*
Product Product
Catalog 1 1..* Description
Employs-to-manage
1 manager
*
Store Employs-to-handle-sales * Person
cashier
1
*
manager worker
Manages4
roles as concepts
Store
1 Employs * Manager
1
Manages 6
1
Employs * Cashier
*
Sale
derived attribute
dateTime
/total
...
Derived Elements
No new information but helps comprehension
Sale
SalesLineItem
/quantity 1 1..*
1 1
Product Contains Product
(b) itemID
Catalog Description
Person
2
*
parent child
Creates 4
Self referential
Unit - 5 : Define Model Refinement 30
Packages
Group elements:
By subject area
In same class hierarchy
In same use cases
Strong associations
Do not know this until the project grows
Domain
Core Elements::
Register
1
Has
Store Register
1 1..*
Captures
Sale
1
Domain
Domain
Authorization
Transactions
Core/Misc
Store
Houses
Register Manager
address 1 1..*
name
1..*
1
Employs
Contents of Core
1 3 Authorizes-payments-of
1..*
Paid-by
Check
1
1
Check Credit
CashPayment Credit Check Authorized-by Authorization Authorization
Payment Payment 1
amountTendered
* Service Service
* * * * 1
Authorized-by
Logs 4
Establishes- Establishes-
credit-for 5 identity-for 5
Authorization Transactions::
1 1 1
PaymentAuthorizationReply
Accounts CreditCard DriversLicense
Receivable
expiryDate number
number - CheckPayments have
1
Identifies CheckPaymentReplies
1 1
Abused-by4 - CreditPayments have
Sales::Customer
1 CreditPaymentReplies
Sales::
SalesLineItem 0..1
Described-by *
1
Product
Description
ProductCatalog description
1 1..*
price
itemID
1
Records-sale-of6
Describes
*
Core:: Stocks Item
Store 1 1
*
Sales
Authorization Transactions
Payment
Authorization
Transaction
Payment Payment
Authorization Authorization
Reply Request