Академический Документы
Профессиональный Документы
Культура Документы
• allow us to create and show the specification for the software classes
that we’ll build
• and also:
• dependencies
Register Sale
Date
isComplete : Boolean
Captures time
addLineItem(…)
… 1 1 makeLineItem()
Register Sale
Domain Model
1 Captures * Date
isComplete : Boolean
time
Register Sale
Design Model Date
1 Captures 1 isComplete : Boolean
addLineItem(…) time
… makeLineItem()
• add attributes
• but note that not all classes and attributes from the
domain model will be used
• expect to identify more methods as you progress (and maybe lose some)
• some points:
• add types
Example: add methods & types
• show when:
• A sends a message to B
• A creates an instance of B
• direction of arrow:
• add visibilities?
• by convention attributes are private and methods public, so we usually don’t need to
represent these
• so just use:
• + for public
• - for private
• for sheer practicality do not waste time modelling the huge number of attributes and
methods contained within a user interface
• just show it’s a <<user interface>> below its name, and show its association to other
classes
...How to Create a DCD...
• avoid clutter
• far quicker and easier to get started with the coding and feed
back ideas and observations
• context helps:
• as you sit down and code you’ll think of things which need to
change with the design
ProductSpecification
SalesLineItem
* Described-by 1 description : Text
quantity : Integer price : Money
itemID : ItemID
getSubtotal():Money
• we can use them to specify in great detail the classes, methods and attributes
which will form the design solution
• some coding now will speed up the analysis and design processes
• when coding:
• a little time spent now forcing user actions to be legal will save a lot of
time debugging and error handling later
• avoid clutter: