software engineering 1 object-oriented analysis and design applying uml and patterns an introduction...

49
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic 3

Upload: alexus-bruton

Post on 28-Mar-2015

228 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering1

Object-oriented Analysis and Design

Applying UML and Patterns

An Introduction to Object-oriented Analysis

and Design and Iterative Development

Part III Elaboration Iteration I – Basic3

Page 2: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering2

Object-oriented Analysis and Design

Chap 18Object Design Examples with GRASP

Page 3: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering3

Object-oriented Analysis and Design

Introduction

This chapter applies OO design principles and the UML to the case studies, to show larger examples of reasonably designed objects with responsibilities and collaborations.

ObjectiveDesign use case realizations.Apply GRASP to assign responsibilities to classes.Apply UML to illustrate and think through the design of

objects No "magic" is needed in object design

Page 4: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering4

Object-oriented Analysis and Design

Use-case realization

A use-case realization describes how a particular use case is realized within the Design Model, in terms of collaborating objects" [RUP].

A designer can describe the design of one or more scenarios of a use case; each of these is called a use case realization

Use case realization is a UP term used to remind us of the connection between the requirements the object design

Some relevant artifact-influence points include the following: The use case suggests the system operations that are shown in

SSDs. The system operations become the starting messages entering

the Controllers for domain layer interaction diagrams. Domain layer interaction diagrams illustrate how objects

interact to fulfill the required tasks - the use case realization.

Page 5: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering5

Object-oriented Analysis and Design

Operation: enterItem(…)

Post-conditions:- . . .

Operation Contracts

Sale

date. . .

SalesLineItem

quantity

1..*1 . . .

. . .

Domain Model

Use-Case Model

Design Model: Register

enterItem(itemID, quantity)

: ProductCatalog

d = getProductDescription(itemID)

addLineItem( d, quantity )

: Sale

Require-ments

Business Modeling

Design

Sample UP Artifact Relationships

: System

enterItem(id, quantity)

Use Case Text

System Sequence Diagrams

makeNewSale()

system events

Cashier

Process Sale

: Cashier

use case

names

system operations

Use Case Diagram

SupplementarySpecification

Glossary

starting events to design for, and detailed post-condition to satisfy

Process Sale

1. Customer arrives ...2. ...3. Cashier enters item identifier.

inspiration for names of some software domain objects

functional requirements that must be realized by the objects

ideas for the post-conditions

Register

...

makeNewSale()enterItem(...)...

ProductCatalog

...

getProductDescription(...)...

1*

non-functional requirements

domain rules

item details, formats, validation

Page 6: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering6

Object-oriented Analysis and Design

Communication diagrams and system operation handling

:RegisterenterItem

:RegisterendSale

:RegistermakePayment

1: ???

1: ???

1: ???

:RegistermakeNewSale 1: ???

makeNewSale, etc., are the system operations from the SSD

each major interaction diagram starts with a system operation going into a domain layer controller object, such as Register

DOMAIN LAYERUI LAYER

Window objects or

GUI widget objectsor

Web control objects

. . .

Page 7: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering7

Object-oriented Analysis and Design

Sequence diagrams and system operation handling

: Register

: Sale

makeNewSalecreate

: Register

enterItem(...)

: ProductCatalog

desc = getProductDesc( itemID )

. . .

UI LAYER

Window objects or

GUI widget objectsor

Web control objects

. . .

DOMAIN LAYER

Page 8: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering8

Object-oriented Analysis and Design

Operation Contract 1

Use case realizations could be designed directly from the use case text or from one's domain knowledge.

For some complex system operations, contracts may have been written that add more analysis detail. For example:

Page 9: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering9

Object-oriented Analysis and Design

Operation Contract 2

1: makeLineItem(...)enterItem(id, qty)

1.1: create(...)

:Register :Sale

:SalesLineItem

In conjunction with contemplating the use case text, for each contract, we work through the postcondition state changes and design message interactions to satisfy the requirements

Page 10: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering10

Object-oriented Analysis and Design

Use case realization with GRASP patterns.

'Start Up' Use Case Step

Design makeNewSale Design enterItem Design endSale Design makePayment Connect the UI Layer to the Domain Layer Create the Initialization Design Applications Start Up

Page 11: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering11

Object-oriented Analysis and Design

'Start Up' Use Case

The Start Up use case realization is the design context in which to consider creating most of the 'root' or long-lived objects.

GuidelineWhen coding, program at least some Start Up initialization

first. But during OO design modeling, consider the Start Up

initialization design last, after you have discovered what really needs to be created and initialized.

Then, design the initialization to support the needs of other use case realizations

Page 12: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering12

Object-oriented Analysis and Design

Design makeNewSale 1

Page 13: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering13

Object-oriented Analysis and Design

Design makeNewSale 2

Choosing the Controller Class Our first design choice involves choosing the controller for the

system operation message enterItem. By the Controller pattern, here are some choices:

Represents the overall "system," "root object," a specialized device, or a major subsystem.

Store a kind of root object because we think of most of the other domain objects as "within" the Store.Register a specialized device that the software runs on; also called a POSTerminal.POSSystem a name suggesting the overall system

Represents a receiver or handler of all system events of a use case scenario.

ProcessSaleHandler constructed from the pattern <use-case-name> "Handler" or "Session"ProcessSaleSession

Page 14: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering14

Object-oriented Analysis and Design

Design makeNewSale 3

:Register

makeNewSale

:Salecreate

Page 15: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering15

Object-oriented Analysis and Design

Design makeNewSale 4

Creating a New SaleWe must create a software Sale object, GRASP Creator pattern suggests assigning the

responsibility for creation to a class that aggregates, contains, or records the object to be created.

Register may be thought of as recording a Sale, Thus, Register is a reasonable candidate for creating a Sale.

By having the Register create the Sale, we can easily associate the Register with it over time so that during future operations within the session, the Register will have a reference to the current Sale instance.

When the Sale is created, it must create an empty collection (such as a Java List) to record all the future SalesLineItem instances that will be added.

Page 16: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering16

Object-oriented Analysis and Design

Design makeNewSale 5

:Register

makeNewSale

:Salecreate

Register creates a Sale by Creator

create lineItems :List<SalesLineItem>

by Creator, Sale creates an empty collection (such as a List) which will eventually hold SalesLineItem instances

by Creator and Controller

this execution specification is implied to be within the constructor of the Sale instance

Page 17: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering17

Object-oriented Analysis and Design

Design enterItem 1

Page 18: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering18

Object-oriented Analysis and Design

Design enterItem 2

Choosing the Controller Class Who can handle the responsibility for the system operation

message enterItem. Based on the Controller pattern, as for makeNewSale, we will

continue to use Register as a controller. Display Item Description and Price?

Because of a principle of Model-View Separation, it is not the responsibility of non-GUI objects (such as a Register or Sale) to get involved in output tasks.

Therefore, although the use case states that the description and price are displayed after this operation, we ignore the design at this time.

All that is required with respect to responsibilities for the display of information is that the information is known, which it is in this case.

Page 19: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering19

Object-oriented Analysis and Design

Design enterItem 3

Creating a New SalesLineItem The enterItem contract postconditions indicate the creation,

initialization, and association of a SalesLineItem. Who create? Based on

Analysis of the Domain Model reveals that a Sale contains SalesLineItem objects.

Taking inspiration from the domain, we determine that a software Sale may similarly contain software SalesLineItem.

The postconditions indicate that the new SalesLineItem needs a quantity when created;

therefore, the Register must pass it along to the Sale, which must pass it along as a parameter in the create message.

In Java, that would be implemented as a constructor call with a parameter. Therefore, by Creator, a makeLineItem message is sent to a Sale for it

to create a SalesLineItem. The Sale creates a SalesLineItem, and then stores the new instance in its permanent collection.

The parameters to the makeLineItem message include the quantity, so that the SalesLineItem can record it, and the ProductDescription that matches the itemID.

Page 20: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering20

Object-oriented Analysis and Design

Design enterItem 4

2: makeLineItem(desc, qty)enterItem(id, qty)

1: desc = getProductDesc(id) 2.1: create(desc, qty)

1.1: desc = get(id)

:Register :Sale

:ProductCatalog

sl: SalesLineItem

lineItems : List<SalesLineItem>

: Map<ProductDescription>

2.2: add(sl)

by Expert

by Controllerby Creator

add the newly created SalesLineItem instance to the List

Page 21: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering21

Object-oriented Analysis and Design

Design enterItem 5

Other design issuesWho should be responsible for knowing a

ProductDescription, based on an itemID match?Start assigning responsibilities by clearly stating the

responsibility Who should send the getProductDescription message to

the ProductCatalog to ask for a ProductDescription For an object to send a message to another object, it must

have visibility to it.

Page 22: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering22

Object-oriented Analysis and Design

Design enterItem 6

SalesLineItem

quantity : Integer

...

ProductCatalog

...

getProductDesc(...)

ProductDescription

description : Textprice : MoneyitemID: ItemID

...

1..*

1..*

Register

...

enterItem(...)...

Sale

isComplete : Booleantime : DateTime

makeLineItem(...)...1

1

1

catalog

currentSale

descriptions{Map}

lineItems{ordered}

description

Partial DCD related to the enterItem design. Static view

Page 23: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering23

Object-oriented Analysis and Design

Design enterItem 7

The enterItem interaction diagram. Dynamic view

Page 24: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering24

Object-oriented Analysis and Design

Design endSale 1

StepChoose the controller classSetting the Sale.isComplete Attribute Calculating the Sale Total Designing Sale.getTotal

Page 25: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering25

Object-oriented Analysis and Design

Design endSale 2

Figure 18.9. Completion of item entry

Page 26: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering26

Object-oriented Analysis and Design

Design endSale 3

Figure 18.10. Sale.getTotal interaction diagram

Page 27: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering27

Object-oriented Analysis and Design

Design endSale 4

Figure 18.12. Showing a method in a note symbol

Page 28: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering28

Object-oriented Analysis and Design

Design makePayment 1

Page 29: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering29

Object-oriented Analysis and Design

Design makePayment 2

Creating the Payment Guideline

When there are alternative design choices, take a closer look at the cohesion and coupling implications of the alternatives, and possibly at the future evolution pressures on the alternatives. Choose an alternative with good cohesion, coupling, and stability in the presence of likely future changes

Logging a Sale Calculating the Balance

Page 30: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering30

Object-oriented Analysis and Design

Design makePayment 3

1: makePayment(cashTendered)

1.1: create(cashTendered)

:Register :Sale

:Payment

makePayment(cashTendered)

by Controller by Creator and Low Coupling

Figure 18.13. Register.makePayment interaction diagram

Page 31: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering31

Object-oriented Analysis and Design

Design makePayment 4

Store

...

addSale(s : Sale)...

SalesLedger

...

addSale(s : Sale)...

Store is responsible for knowing and adding completed Sales.

Acceptable in early development cycles if the Store has few responsibilities.

SalesLedger is responsible for knowing and adding completed Sales.

Suitable when the design grows and the Store becomes uncohesive.

Sale

...

...

Sale

...

...

Logs-completed Logs-completed

* *

1 1

Figure 18.14. Who should be responsible for knowing the completed sales?

Page 32: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering32

Object-oriented Analysis and Design

Design makePayment 5

1: makePayment(cashTendered)

1.1: create(cashTendered)

:Register s :Sale

:Payment

makePayment(cashTendered)

:Store

2: addSale(s)

completedSales: List<Sale>

2.1: add(s)

by Expert

note that the Sale instance is named's' so that it can be referenced as a parameter in messages 2 and 2.1

Figure 18.15. Logging a completed sale

Page 33: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering33

Object-oriented Analysis and Design

Design makePayment 6

s :Sale pmt: Payment1: amt = getAmountbal = getBalance

2: t = getTotal

{ bal = pmt.amount - s.total }

Figure 18.16. Sale.getBalance interaction diagram

Page 34: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering34

Object-oriented Analysis and Design

Design makePayment 7

SalesLineItem

quantity : Integer

getSubtotal()

ProductCatalog

...

getProductDesc(...)

ProductDescription

description : Textprice : MoneyitemID: ItemID

...

Store

address : Addressname : Text

addCompleteSale(...)

Payment

amount : Money

...

1..*

1..*

Register

...

endSale()enterItem(...)makeNewSale()makePayment(...)

Sale

isComplete : Booleantime : DateTime

becomeComplete()makeLineItem(...)makePayment(...)getTotal()

1

1

1

1

1

1

*

catalog

catalog

register

currentSale

descriptions{Map}

lineItems{ordered}

payment

completedSales{ordered}

description

Figure 18.17. A more complete DCD reflecting most design decisions

Page 35: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering35

Object-oriented Analysis and Design

Connect the UI Layer to the Domain Layer 1

Common designs by which objects in the UI layer obtain visibility to objects in the domain layer include the following:

An initializer object (for example, a Factory object) called from the application starting method (e.g., the Java main method) creates both a UI and a domain object and passes the domain object to the UI.

A UI object retrieves the domain object from a well-known source, such as a factory object that is responsible for creating domain objects.

Once the UI object has a connection to the Register instance (the facade controller in this design), it can forward system event messages, such as the enterItem and endSale message, to it

Page 36: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering36

Object-oriented Analysis and Design

Connect the UI Layer to the Domain Layer 2

:Register

Cashier

:ProcessSaleJFrame

actionPerformed( actionEvent )

1: enterItem(id, qty) system event

UILayer

DomainLayer

presses button

Figure 18.18. Connecting the UI and domain layers.

Page 37: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering37

Object-oriented Analysis and Design

Initialization and the 'Start Up' Use Case

When to Create the Initialization Design?Guideline: Do the initialization design last.

How do Applications Start Up?

public class Main { public static void main( String[] args ) { // Store is the initial domain object. // The Store creates some other domain objects. Store store = new Store(); Register register = store.getRegister(); ProcessSaleJFrame frame = new ProcessSaleJFrame( register ); ... } }

Page 38: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering38

Object-oriented Analysis and Design

:Store :Register

pc:ProductCatalog

create 2: create(pc)

1: create

1.2: loadProdSpecs()

descriptions:Map<ProductDescription>

1.1: create

1.2.2*: put(id, pd)

1.2.1*: create(id, price, description)

pd:ProductDescriptionthe * in sequence number indicates the

message occurs in a repeating section

pass a reference to the ProductCatalog to the Register, so that it has permanent visibility to it

by Creatorcreate an empty collection object

Page 39: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering39

Object-oriented Analysis and Design

Use Case Realizations for the Monopoly Iteration 1

Choosing the Controller Class Choosing a root-object facade controller like

MonopolyGame is satisfactory if there are only a few system operations (there are only two in this use case) and if the facade controller is not taking on too many responsibilities (in other words, if it is not becoming incohesive).

Who is Responsible for Controlling the Game Loop By Expert, MonopolyGame is a justifiable choice to

control the game loop and coordinate the playing of each round.

Page 40: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering40

Object-oriented Analysis and Design

Figure 18.21. Iteration-1 Domain Model for Monopoly

Page 41: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering41

Object-oriented Analysis and Design

Figure 18.22. Applying Controller to the playGame system operation.

Page 42: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering42

Object-oriented Analysis and Design

Figure 18.23. Game loop

Page 43: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering43

Object-oriented Analysis and Design

Use Case Realizations for the Monopoly Iteration 2

Who Takes a Turn Again, Expert applies Naive reaction might be to say "a Player object should

take the turn" because in the real world a human player takes a turn.

This is an interesting problem! There are three partial information experts for the "take a turn" responsibility: Player, MonopolyGame, and Board.

Page 44: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering44

Object-oriented Analysis and Design

Use Case Realizations for the Monopoly Iteration 3

Who Takes a Turn (conti.) Guideline: When there are multiple partial information experts

to choose from, place the responsibility in the dominant information expert - the object with the majority of the information. This tends to best support Low Coupling.

Guideline: When there are alternative design choices, consider the coupling and cohesion impact of each, and choose the best.

Guideline: When there is no clear winner from the alternatives other guidelines, consider probable future evolution of the software objects and the impact in terms of Information Expert, cohesion, and coupling.

In the end, by these guidelines Player turns out to be a good candidate, justified by Expert when we consider the full game rules.

Page 45: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering45

Object-oriented Analysis and Design

Use Case Realizations for the Monopoly Iteration 3

Figure 18.24. Player takes a turn by Expert

Page 46: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering46

Object-oriented Analysis and Design

Use Case Realizations for the Monopoly Iteration 4

Figure 18.25. Dynamic design for playGame

Page 47: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering47

Object-oriented Analysis and Design

The Command-Query Separation Principle

This principle states that every method should either be:a command method that performs an action (updating,

coordinating, …), often has side effects such as changing the state of objects, and is void (no return value); or

a query that returns data to the caller and has no side effects - it should not permanently change the state of any objects

Page 48: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering48

Object-oriented Analysis and Design

Initialization and the 'Start Up' Use Case

Figure 18.27. Creation dependencies

Page 49: Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative

Software Engineering49

Object-oriented Analysis and Design

Sample process and setting context

January February

WhenNear the beginning of each iteration, for a "short" period before programming.

WhereIn a project room with lots of support for drawing and viewing drawings.

WhoPerhaps developers will do some design work in pairs. The software architect will collaborate, mentor, and visit with different design groups.

How: ToolsSoftware: A UML CASE tool that can also reverse engineer diagrams from code.

Hardware: - Use two projectors attached to dual video cards.- For whiteboard drawings, perhaps a digital camera.- To print noteworthy diagrams for the entire team, a plotter for large-scale drawings to hang on walls.

DeveloperDeveloper

SoftwareArchitect

Two adjacent projections.

: R e g is te r

e n te r Ite m( ite mID , qu a n tity )

: Pro d u c tC ata log

s pe c := g e tSp ec ific a tio n ( itemID )

a dd L in e Ite m( s p e c , q u an tity )

: Sa le

. . .

mak e N e w Sa le ( )c r ea te ( )

. . .

: R e g is te r

en te r Item( ite mID , q u a n tity )

: Pr od uc tC a ta lo g

s pe c := g e tSpe c ific a tion ( ite mID )

ad dL ine Item( s p e c , q u a n tity )

: Sa le

. . .

ma k e N ew Sa le ( )c re a te ( )

. . .

SalesLineItem

quantity : Integer

getSubtotal()

Produc tCatalog

getSpec ific ation( )

ProductSpecification

des cr iption : Tex tpr ic e : MoneyitemID : ItemID

Store

addres s : Addres sname : Tex t

addSale( )

Payment

amount : Money

1..*

1..*

Regis ter

endSale( )enter Item()makeNewSale( )makePay ment( )

Sale

date : D ateisComplete : Booleantime : Time

bec omeComplete( )mak eLineItem( )mak ePayment()getTotal( )

1 1

1

1 1

1

11

1

1

1

1

1

*

*

1

whiteboards