Dittman Date:__10/17/96_ USE CASE NAME: Submit Promotion Order ACTOR: Club Member - System user: Promotion Order Specialist DESCRIPTION: Describes the process when a club member submits
Trang 1Object-Oriented Design
Introduction
What is the difference between entity, interface, and control
objects?
What is the basic concept object responsibility and how it is
related to message sending between object types?
What is the important of considering object reuse during systems design?
What are three activities involved in completing object design?
How do you construct an Ideal Object Model Diagram, CRC Card, and Object Interaction Diagram?
Trang 2 Objects which represent a means through which the user will
interface with the system are called Interface Objects
Objects that hold application or business rule logic are called
Trang 3Object-Oriented Design
An Introduction to Object-Oriented
Design
The three object types correlate well with the client-server model
The client is responsible for the application logic (control objects) and presentation method (interface objects)
The server is responsible for the repository (entity objects)
Trang 4 The responsibility of the interface object is two fold:
• It translates the user’s input into information that the system can
understand and use to process the business event
• It takes data pertaining to a business event and translates the data
for appropriate presentation to the user
Each actor or user needs its own interface object to communicate with the system
• In some cases the user may need multiple interface objects
In te rfa ce O bje ct
Trang 5 They also encapsulate those behaviors that maintains its information or attributes
An entity object is said to be persistent meaning the object
typically outlives the execution of a use case (or program)
• An entity object exists between use case executions because the
information about that entity object is typically stored in a database (allowing for later retrieval and manipulation)
En ti ty O bj ect
Trang 6• Such behavior is related to the management of the interactions of objects
to support the functionality of the use case.
Controller objects serve as the “traffic cop” containing the application logic or business rules of the event for managing or directing the
interaction between the objects
Controller objects allow the scenario to be more robust and simplifies the task of maintaining that process once it is implemented
As a general rule of thumb, within a use case, a control object should
be associated with one and only one actor
C on tro l O bject
Trang 7 An object responsibility is the obligation that an object has to
provide a service when requested and thus collaborating with other objects to satisfy the request if required
Object responsibility is closely related to the concept of objects being able to send and/or respond to messages
Trang 8 The results were impressive as indicated in the following table:
PL/1 19 calendar months 152 person months 265,000 lines of code Smalltalk 3.5 calendar months 10.4 person months 22,000 lines of codes
In order to maximize the ability to reuse objects, objects have to be correctly designed within a good generalization/specialization
hierarchy
The goal is to make objects general enough to be easily used in other applications
Trang 9Object-Oriented Design
Many companies achieve their highest level of reuse by exploiting
object frameworks.
An object framework is a set of related, interacting objects
that provide a well-defined set of services for a accomplishing
a task
By using object frameworks, developers can concentrate on
developing the logic that is new or unique to the application, thus reducing the overall time required to build the entire system
An Introduction to Object-Oriented
Design
Trang 10Object-Oriented Design The Process of Object Design
Refining the use case model to reflect the implementation
Trang 11Object-Oriented Design The Process of Object Design
Implementation Environment
The use cases will be refined to include details of how the actor (or user) will actually interface with the system and how the
system will respond to that stimulus to process the business event
Refining the use cases is essential because they will be:
The basis upon which subsequent user manuals and test scripts are developed during systems implementation
Will be used by programmers to construct application programs during systems implementation
May discover new use cases
Trang 12Object-Oriented Design The Process of Object Design
Refining the Use Case Model to Reflect the
Implementation Environment
To simplify a use case, extract complex steps into its own use case
called an extension use case.
An extension use case extends the functionality of the original
called an abstract use case that can be “called” by other use cases
Trang 13Object-Oriented Design
Generate Order
Error Report
Send Order Rejection Notice
Extension Use Cases
Abstract Use Cases
Trang 14Object-Oriented Design The Process of Object Design
Keep the original analysis use cases separate from the refined design use cases to allow maximum flexibility in reusing use cases for variations of different physical implementations
Trang 15Object-Oriented DesignDESIGN USE CASE
Author: K Dittman Date: 10/17/96_
USE CASE NAME: Submit Promotion Order
ACTOR: Club Member - System user: Promotion Order Specialist
DESCRIPTION: Describes the process when a club member submits a promotion order to either indicate the
products they are interested in ordering or declining to order during this promotion.
NORMAL COURSE: The main window is currently displayed on the screen waiting for the promotion order
specialist to select a menu option.
1 When a promotion order is received from the club member, this use case is initiated when the promotion order specialist selects the option “Process Promotion Order”, displaying a window requesting the club member’s NUMBER to be entered.
2 The promotion order specialist enters the MEMBER NUMBER The system verifies that the number is valid and if it is, displays three windows The first window contains the club member’s personal information including: NAME, STATUS, STREET ADDRESS, P O BOX, CITY, STATE, ZIP, DAYTIME PHONE NUMBER, DATE OF LAST ORDER, BALANCE DUE , and BONUS BALANCE The second window contains the promotion order header record information that was created when the promotion was sent to the club member The second window contains: ORDER NUMBER, ORDER CREATION DATE, ORDER AUTOMATIC FILL DATE, SUB-TOTAL COST, SALES TAX, and ORDER STATUS The third window contains the individual ordered products This is a multi-lined window with the first order line containing the selection of the month information This record was also created when the promotion was sent to the club member The third window contains: PRODUCT NUMBER, PRODUCT NAME, QUANTITY AVAILABLE, QUANTITY ORDERED, QUANTITY BACKORDERED, SUGGESTED UNIT PRICE, PURCHASED UNIT PRICE, EXTENDED COST, CREDITS EARNED, and ORDERED PRODUCT STATUS.
3 The promotion order specialist checks to see if the club member has made any address or phone number changes on the promotion order.
If no changes have been made, the promotion order specialist checks the promotion order
to see if any products are being ordered.
If products are being ordered, the promotion order specialist positions the cursor in the ordered product window.
4 The promotion order specialist checks the promotion order to see if the club member has accepted or declined the selection of the month If accepted, the promotion order specialist checks quantity ordered to see if it is greater than one If so, the promotion order specialist edits the QUANTITY ORDERED field to reflect the new quantity The system calculates the new EXTENDED COST by multiplying the PURCHASED UNIT PRICE times the QUANTITY ORDERED and then advances the cursor to the next line.
5 The promotion order specialist checks the promotion order to see if the club member has ordered additional products If so, the promotion order specialist enters the PRODUCT NUMBER of the next item being ordered The system displays the PRODUCT NAME, QUANTITY AVAILABLE, and the SUGGESTED UNIT PRICE The promotion order specialist enters the QUANTITY ORDERED, and the PURCHASE UNIT PRICE The system calculates the new EXTENDED COST by multiplying the PURCHASE UNIT PRICE times the QUANTITY ORDERED It also updates the ORDERED PRODUCT STATUS field to be “open”, and then advances the cursor to the next line.
This step is repeated until all ordered products have been input.
6 Once all ordered products have been entered into the system, the promotion order specialist commits the order.
Invoke extension use case Calculate Subtotal and Sales Tax.
1
2
5
Trang 163a If the club member indicates an address or telephone number change on the promotion order, the promotion order specialist selects the option to update the club member’s personal information The personal information window is activated for update The promotion order specialist updates the required fields and saves the changes.
3b If the club member is not ordering product at this time, the promotion order specialist clicks the button “ Order Declined ” The system modifies the ORDER STATUS field to have a status of “closed” and modifies the ORDERED PRODUCT STATUS field (for the selection of the month) to have a status of “rejected” The changes are saved and then the system prompts the user to process a new order or cancel the transaction.
4 If the club member is not ordering the selection of the month, the promotion order specialist clicks the button “Selection of the Month Declined” The system modifies the ORDERED PRODUCT STATUS field (for the selection of the month) to have a status of
“rejected” The cursor is then advanced to the next line 5a If no additional products are being ordered, proceed to step 6 of the normal course 5b If the PRODUCT NUMBER or QUANTITY ORDERED is not valid, the system hi-lights the fields indicating those fields have invalid entries The promotion order specialist either corrects the entries or advances to the next line In a later step an error report will be generated for any invalid entries.
6a If the club members status is not acceptable, invoke abstract use case Send Order Rejection
Notice The system modifies the ORDER STATUS field to have a status of “on hold
pending payment” The changes are saved and the system prompts the user to process a new order or cancel the transaction.
6b If the QUANTITY ORDERED is greater than the QUANTITY AVAILBLE, the NUMBER
TO BE PICKED will be set to the QUANTITY AVAILBLE The system will reduce the QUANTITY AVAILABLE to zero(if it is not already) and update QUANTITY BACKORDERED to be equal to the QUANTITY ORDERED minus the NUMBER TO BE PICKED.
6c If there are invalid product numbers or quantity ordered entries, invoke abstract use case
Generate Order Error Report.
PRE-CONDITION: Use case Send Club Promotion has been processed.
Use case User Logs In has been processed.
POST-CONDITION: Promotion order has been recorded and the Picking Ticket has been routed to the Warehouse.
ASSUMPTIONS:
4
5
Trang 17Object-Oriented Design The Process of Object Design
Implementation Environment
Step 2 - Updating the Use Case Model Diagram and Other
Documentation to Reflect Any New Use Cases:
In this step the use case model diagram, the use case dependency diagram, and the actor and use case glossaries should be updated to reflect any new information introduced in step 1
• It is very important to keep documentation accurate and current.
Trang 18Object-Oriented Design The Process of Object Design
Support the Use Case Scenario
In this activity we want to identify and categorize the design
objects required by the functionality that was specified in each use case, and identify the object interactions, their responsibilities, and their behaviors
Step 1 - Identify and Classify Use Case Design Objects:
In this step we examine each design use case to identify and classify the types of objects (interface, control, and entity) required by the logic of the use case or business scenario
Trang 19Object-Oriented Design
INTERFACE OBJECTS CONTROLLER OBJECTS ENTITY OBJECTS
Member Services Main Window Order Processor MEMBER
Order Processing Window Ticket Generator PRODUCT
MEMBER ORDERED PRODUCT
Trang 20Object-Oriented Design The Process of Object Design
Support the Use Case Scenario
Step 2 - Identify Object Attributes:
During both analysis and design, object attributes may be discovered
In this step we examine each use case for additional attributes which hasn’t been previously identified, and update our object association diagram to include attributes
Trang 21Member Street Address
Member P.O Box Number
Member City
Member State
Member Zip Cpde
Member Daytime Phone Number
Date Of Last Order
Member Balance Due
Member Bonus Balance
persistent
MEMBER ORDERED PRODUCT Quantity Ordered
Quantity Shipped Quantity Backordered Purchased Unit Price Extended Cost Credits Earned Ordered Product Status
MEMBER ORDER Order Number Order Creation Date Order Automatic Fill Date Order Sub-total Cost Order Sales Tax Order Status
Trang 22Object-Oriented Design The Process of Object Design
Support the Use Case Scenario
Step 3 - Model High-Level Object Interactions for a Use Case
In this step an Ideal Object Model Diagram is created to
model the interactions of the design objects involved in each use case
An ideal object model diagram includes symbols to represent actors, interface, control and entity objects, and arrows which represent messages or communication between the objects
Trang 23Object-Oriented Design
PROMOTION ORDER SPECIALIST
WAREHOUSE
CLUB MEMBER
Picking Ticket Printer
Order Processing Window
PRODUCT ON ORDER MEMBER ORDER
Main Window
Ticket Generator
MEMBER
PRODUCT Order Processor
SUBMIT PROMOTION ORDER IDEAL OBJECT DIAGRAM
3
Trang 24Object-Oriented Design The Process of Object Design
Support the Use Case Scenario
Step 4 - Identify Object Behaviors and Responsibilities
This step involves the following tasks:
Our first task in identifying the object behaviors and
responsibilities is accomplished by examining each use case
description to identify all action verb phrases
a use case scenario
Trang 25Object-Oriented Design
DESIGN USE CASE Author: K Dittman Date: 10/17/96_
USE CASE NAME: Submit Promotion Order
ACTOR: Club Member - System user: Promotion Order Specialist
DESCRIPTION: Describes the process when a club member submits a promotion order to either indicate the
products they are interested in ordering or declining to order during this promotion.
NORMAL COURSE: The main window is currently displayed on the screen waiting for the promotion order
specialist to select a menu option.
1 When a promotion order is received from the club member, this use case is initiated when the promotion order specialist selects the option “Process Promotion Order”, displaying a window requesting the club member’s NUMBER to be entered.
2 The promotion order specialist enters the MEMBER NUMBER The system verifies that the number is valid and if it is, displays three windows The first window contains the club member’s personal information including: NAME, STATUS, STREET ADDRESS, P O.
BOX, CITY, STATE, ZIP, DAYTIME PHONE NUMBER, DATE OF LAST ORDER, BALANCE DUE, and BONUS BALANCE The second window contains the promotion order header record information that was created when the promotion was sent to the club member The second window contains: ORDER NUMBER, ORDER CREATION DATE, ORDER AUTOMATIC FILL DATE, SUB-TOTAL COST, SALES TAX, and ORDER STATUS The third window contains the individual ordered products This is a multi-lined window with the first order line containing the selection of the month information This record was also created when the promotion was sent to the club member The third window contains: PRODUCT NUMBER, PRODUCT NAME, QUANTITY AVAILABLE, QUANTITY ORDERED, QUANTITY BACKORDERED, SUGGESTED UNIT PRICE, PURCHASED UNIT PRICE, EXTENDED COST, CREDITS EARNED, and ORDERED PRODUCT STATUS.
3 The promotion order specialist checks to see if the club member has made any address or phone number changes on the promotion order.
If no changes have been made, the promotion order specialist checks the promotion order
to see if any products are being ordered.
If products are being ordered, the promotion order specialist positions the cursor in the ordered product window.
4 The promotion order specialist checks the promotion order to see if the club member has accepted or declined the selection of the month If accepted, the promotion order specialist checks quantity ordered to see if it is greater than one If so, the promotion order specialist edits the QUANTITY ORDERED field to reflect the new quantity The system calculates the new EXTENDED COST by multiplying the PURCHASED UNIT PRICE times the QUANTITY ORDERED and then advances the cursor to the next line.
5 The promotion order specialist checks the promotion order to see if the club member has ordered additional products If so, the promotion order specialist enters the PRODUCT NUMBER of the next item being ordered The system displays the PRODUCT NAME, QUANTITY AVAILABLE, and the SUGGESTED UNIT PRICE The promotion order
specialist enters the QUANTITY ORDERED, and the PURCHASE UNIT PRICE The
system calculates the new EXTENDED COST by multiplying the PURCHASE UNIT PRICE times the QUANTITY ORDERED It also updates the ORDERED PRODUCT STATUS field to be “open”, and then advances the cursor to the next line.
This step is repeated until all ordered products have been input.
6 Once all ordered products have been entered into the system, the promotion order specialist commits the order.
Invoke extension use case Calculate Subtotal and Sales Tax.
The system checks the club member’s STATUS If the club member is in good standing,