Sei sulla pagina 1di 16

IntellAgile

Visualizing
Concepts
with a
Domain
Model
www.craiglarman.com
Copyright 2002 Craig Larman. All rights reserved.

Overview

IntellAgile

A Domain Model visualizes noteworthy

concepts or objects in the domain.

You will be able to:

Read and write the UML class diagram


notation for a Domain Model
Create a Domain Model
Apply guidelines
Relate it to other artifacts

use cases

sys. sequence diagrams

domain models

operation contract

IntellAgile

DEFINITION & MOTIVATION: Domain Model

A Domain Model visualizes, using UML class

diagram notation, noteworthy concepts or


objects.
It is a kind of visual dictionary.
Not a picture of software classes.

It helps us identify, relate and visualize

important information.

It provides inspiration for later creation of

software design classes, to reduce


representational gap.
use cases

sys. sequence diagrams

domain models

operation contract

EXAMPLE: Partial Domain Model

IntellAgile

R e n ts

C u s to m e r
a d d re s s
nam e
phoneN um ber

use cases

1 ..*

V id e o S to r e
R e n ts -fro m

a d d re s s
nam e
phoneN um ber

sys. sequence diagrams

S to c k s
1

domain models

V id e o

ID

operation contract

GUIDELINES: Finding Domain Concepts

IntellAgile

Candidate lists (see text, p. 134)


Abbott Analysis; AKA Linguistic Analysis

Most simply, pick out the nouns

Existing analysis patterns:

use cases

sys. sequence diagrams

domain models

operation contract

UML: Associations

IntellAgile

-"direction reading arrow"


-it has no meaning except to indicate direction of
reading the association label
-optional

VideoStore

Stocks

association name

use cases

sys. sequence diagrams

Video

multiplicity

domain models

operation contract

UML: Multiplicity

IntellAgile

*
1..*

1..40

zero or more;
"many"
Customer

one or more

0..1
Rents

one to forty

*
5

3, 5, 8

exactly five

exactly three,
five or eight

use cases

sys. sequence diagrams

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.

Video

domain models

operation contract

GUIDELINES: Associations

IntellAgile

Only add associations for noteworthy relationships.


Literally, those for which making a note is worthy
or business motivated.
Video
1..*
1
Customer
...

...

Rents

Important association.
Need to remember.

Influenced-by

1
...

Low value association.


Possible, but so what?
use cases

sys. sequence diagrams

Loan Policy

domain models

operation contract

UML and GUIDELINES: Attributes

IntellAgile

Show only simple relatively primitive types

as attributes.

Connections to other concepts are to be

represented as associations, not attributes.


P aym ent

a ttr ib u te s

d a te : D a te
tim e : T im e
am ount : M oney

use cases

sys. sequence diagrams

domain models

operation contract

GUIDELINES: Attributes

IntellAgile

Why??

Customer

Video

Worse
rentedVideos: List of Video

Customer
Better

renter : Customer

Rents

...

use cases

sys. sequence diagrams

1..*

Video
...

domain models

operation contract

EXAMPLE: Domain Model

IntellAgile
Pays-for-overdue-charges

VideoRental
CashPayment

RentalTransaction

Pays-for

amount : Money

1
date

dueDate
returnDate
returnTime

1..*

Initiates
1

0..1

Records-rental-of

Rents

Customer

1..*

VideoStore
Rents-from

address
name
phoneNumber

1
Maintains

Has
1

ID

1
Owns-a

Membership

Video

Stocks

address
name
phoneNumber

Notice how this can


be viewed as a
visual dictionary.
It illustrates
concepts, words,
things in a domain.

Catalog

ID
startDate

1
Described-by
1

1..*
VideoDescription

LoanPolicy
perDayRentalCharge
perDayLateCharge
1..*

use cases

Defines
1..*

title
subjectCategory
Determines-rental-charge

sys. sequence diagrams

domain models

operation contract

IntellAgile

1. In small teams at the whiteboard, draw a

partial Domain Model, limited to the Main


Success Scenario of the Process Sale use
case, and assuming iteration 1
simplifications.

Use the texts use case as the basis. p.


50

Apply the guidelines

use cases

sys. sequence diagrams

domain models

operation contract

Artifacts in the UP Use-Case Model

IntellAgile

Domain
Model

Business
Modeling

Partial artifacts,
refined in each
iteration.

*
Use-Case Model

:System

Requirements
text
use
cases

use
case
diagrams

system
sequence
diagrams

system
operations

system
operation
contracts

Design Model

Design
use cases

sys. sequence diagrams

domain models

operation contract

Recommended Resources

IntellAgile

use cases

sys. sequence diagrams

domain models

operation contract

IntellAgile

1. Without notes, draw all UP disciplines and

artifacts discussed, and relate them.

use cases

sys. sequence diagrams

domain models

operation contract

IntellAgile

1. Objectives assessment. Can you:

Read and write the UML class diagram


notation for a Domain Model

Create a Domain Model

Apply guidelines

Relate it to other artifacts

use cases

sys. sequence diagrams

domain models

operation contract

Potrebbero piacerti anche