Upload
chiko-mah-byasabyasa
View
219
Download
0
Embed Size (px)
Citation preview
8/18/2019 Visualizing Concepts With a Domain Model
1/16
Intell Agile
www.craiglarman.comCopyright © 2002 Craig Larman. All rights reserved.
VisualizingVisualizingConceptsConcepts
with awith aDomainDomainModelModel
8/18/2019 Visualizing Concepts With a Domain Model
2/16
Intell Agile OverviewOverview
A Domain Model visualizes noteworthyA Domain Model visualizes noteworthy
concepts or o!ects in the domain.concepts or o!ects in the domain.
"ou will e ale to# "ou will e ale to#
$ead and write the %ML class diagram$ead and write the %ML class diagram
notation &or a Domain Modelnotation &or a Domain Model
Create a Domain ModelCreate a Domain Model
Apply guidelinesApply guidelines $elate it to other arti&acts$elate it to other arti&acts
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
3/16
Intell Agile D'()*)+)O* , MO+)-A+)O*# Domain ModelD'()*)+)O* , MO+)-A+)O*# Domain Model
AA Domain ModelDomain Model visualizes using %ML classvisualizes using %ML class
diagram notation noteworthy concepts ordiagram notation noteworthy concepts or
o!ects.o!ects. )t is a /ind o& visual dictionary.1)t is a /ind o& visual dictionary.1
Not Not a picture o& so&tware classes.a picture o& so&tware classes.
)t helps us identi&y relate and visualize)t helps us identi&y relate and visualize
important in&ormation.important in&ormation.
)t provides inspiration &or later creation o&)t provides inspiration &or later creation o&
so&tware design classes to reduceso&tware design classes to reduce
representational gap.1representational gap.1
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
4/16
Intell Agile 'AM3L'# 3artial Domain Model'AM3L'# 3artial Domain Model
V i d e o
I D
S t o c k s
R e n t s
R e n t s - f r o m
11 . . *
1 *1
*
V i d e o S t o r e
a d d r e s s
n a m e
p h o n e N u m e r
! u s t o m e r
a d d r e s s
n a m e
p h o n e N u m e r
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
5/16
Intell Agile 4%)D'L)*'5# (inding Domain Concepts4%)D'L)*'5# (inding Domain Concepts
Candidate lists 6see te7t p. 89:;Candidate lists 6see te7t p. 89:;
Aott1 Analysis< A=A Linguistic AnalysisAott1 Analysis< A=A Linguistic Analysis
Most simply pic/ out the nouns1Most simply pic/ out the nouns1
'7isting analysis patterns#'7isting analysis patterns#
use cases sys. sequence diagrams domain models operation contract
http://www.amazon.com/exec/obidos/tg/stores/detail/-/books/0201895420/reader/2/002-3439525-6842407http://www.amazon.com/exec/obidos/tg/stores/detail/-/books/0932633293/reader/2/002-3439525-6842407
8/18/2019 Visualizing Concepts With a Domain Model
6/16
Intell Agile %ML# Associations%ML# Associations
VideoVideoStoreStocks
*1
association name multiplicity
-"direction reading arro#"
-it has no meaning e$cept to indicate direction of
reading the association lael
-optional
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
7/16
Intell Agile %ML# Multiplicity%ML# Multiplicity
%ero or more&
"many"
one or more
one to forty
e$actly fi'e
(
(
(
(
*
1..*
1..)
+
(,- +- e$actly three-
fi'e or eight
!ustomer
Video
Rents
*
/ne instance of a
!ustomer may e
renting %ero or more
Videos.
/ne instance of a Video
may e eing rented y
%ero or one !ustomers.
..1
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
8/16
Intell Agile 4%)D'L)*'5# Associations4%)D'L)*'5# Associations
Only add associations &orOnly add associations &or noteworthy noteworthy relationships.relationships.
Literally those &or which ma/ing a note1 is worthyLiterally those &or which ma/ing a note1 is worthy
or usiness motivated.or usiness motivated.Video
...Rents
Influenced-y
1
1..*
1 0oan olicy
...
!ustomer
...
Important association.
Need to rememer.
0o# 'alue association.
ossile ut so #hat2
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
9/16
Intell Agile %ML and 4%)D'L)*'5# Attriutes%ML and 4%)D'L)*'5# Attriutes
5how only simple1 relatively primitive types5how only simple1 relatively primitive types
as attriutes.as attriutes.
Connections to other concepts are to eConnections to other concepts are to e
represented as associations not attriutes.represented as associations not attriutes.
a y m e n t
d a t e 3 D a t e
t i m e 3 ( i m e
a m o u n t 3 4 o n e y
a t t r i u t e s
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
10/16
Intell Agile 4%)D'L)*'5# Attriutes4%)D'L)*'5# Attriutes
>hy??>hy??
Video
...Rents
1 1..*!ustomer
...5etter
Video
renter 3 !ustomer
!ustomer
rentedVideos3 0ist of Video6orse
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
11/16
Intell Agile 'AM3L'# Domain Model'AM3L'# Domain Model
!atalog
VideoDescription
title
su7ect!ategory
VideoRental
dueDate
returnDate
return(ime
!ashayment
amount 3 4oney
Video
ID
Stocks
Rents
Rents-from
ays-for
Initiates
/#ns-a
Descried-y
4emership
ID
startDate
1
1
1..*
1
1
1
1..*
1
1
*
1
1
1
*1*
ays-for-o'erdue-charges
Rental(ransaction
date
0oanolicy
perDayRental!harge
perDay0ate!harge
Determines-rental-charge
1
Defines
1..*
*
1..*
1
1
* *
VideoStore
address
namephoneNumer
!ustomer
address
namephoneNumer
1
1
1..*
Records-rental-of
..1
1
8as 4aintains
*
1
1
Notice how this can
be viewed as a
“visual dictionary.”
It illustrates concepts, words,
things in a domain.
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
12/16
Intell Agile
8.8. )n small teams at the whiteoard draw a)n small teams at the whiteoard draw a
partial Domain Model limited to the Mainpartial Domain Model limited to the Main
5uccess 5cenario o& the5uccess 5cenario o& the Process SaleProcess Sale useusecase and assuming iteration 8case and assuming iteration 8
[email protected]@cations.
%se the te7ts use case as the asis. p.%se the te7ts use case as the asis. p.B0B0
Apply the guidelinesApply the guidelines
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
13/16
Intell Agile
Domain
Model
Requirements
BusinessModeling
Design
Partialartifacts,
refined in each
iteration.
Use-Case Model
text
use
cases
:System
system
operationcontracts
system
sequence
diagrams
use
case
diagrams
*
*
Design Model
system
operations
Arti&acts in the %3 %seCase ModelArti&acts in the %3 %seCase Model
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
14/16
Intell Agile $ecommended $esources$ecommended $esources
use cases sys. sequence diagrams domain models operation contract
http://www.amazon.com/exec/obidos/tg/stores/detail/-/books/0471380237/reader/2/002-3439525-6842407
8/18/2019 Visualizing Concepts With a Domain Model
15/16
Intell Agile
8.8. >ithout notes draw all %3 disciplines and>ithout notes draw all %3 disciplines and
arti&acts discussed and relate them.arti&acts discussed and relate them.
use cases sys. sequence diagrams domain models operation contract
8/18/2019 Visualizing Concepts With a Domain Model
16/16
Intell Agile
8.8. O!ectives assessment. Can you#O!ectives assessment. Can you#
$ead and write the %ML class diagram$ead and write the %ML class diagram
notation &or a Domain Modelnotation &or a Domain Model
Create a Domain ModelCreate a Domain Model
Apply guidelinesApply guidelines
$elate it to other arti&acts$elate it to other arti&acts
use cases sys sequence diagrams domain models operation contract