Académique Documents
Professionnel Documents
Culture Documents
OO Analysis
- Requirement Analysis
OO Design
- Architectural Design
- Class/Algorithm Design
OO Programming
Testing and maintainance
Case Study Example - OPS
OPS Order Processing System for online store
<<include <<extend
>> >>
<<include <<include
>> >>
<<include
<<include >>
<<include
>>
>>
Scenarios
(4) if user name not exists, insert the user, and display
registration success page; otherwise display failure
page.
Session use case
1. Customer log in using correct user
name and password, the customer starts a
session.
Example:
system:
- system reports error in the initial description of
the use case is not accurate enough.
- rephrase it as errors are reported in a
RegistrationErrorPage.
- Thus a RegistrationErrorPage should be created as a
boundary class.
Results of Analysis (Sample)
III
error:
- should not be modeled as a class.
success:
- RegistrationSuccessPage should be created as a
boundary class.
real name: part of the CustomerInfomation class.
billing address: part of CustomerInfomation class.
database system: A boundary class called
CustomerInfoDB should be created to interact with the
customer database.
28
Classes from Registration use
case(1)
RegistrationPage a boundary class for
registration.
ShippingDeptWrapper a boundary
class for interacting with shipping
department.
Registration use
case
OO Design
OO Design (1)
Class-Responsibility-Collaborator (CRC)
Identify classes to build a system and
assign responsibilities to each class
CRC card modeling is a team work
1 Facilitator
1 Domain User
4-6 System Analyzer and Designer
Step 1: CRC Card Approach
(2)
1 Facilitator
- Carries the discussion session
1 Domain User
- experts in business model
- Knows the business logic well and should have
good communication skills for explaining the
business needs to OO Design Analysts
System Analyzer and Designer (4-6)
- knows OO modeling well and are responsible for
filling out the contents of the cards.
Card (1)
Class Name
Responsibility Collaborators
Card (2)
A responsibility is a task that must be
performed by the class, or the knowledge
that is known by the class.
Example: one responsibility of the
SessionController class might be to
perform the adding item operation.
Card (3)
A collaborator is a class that is involved in
accomplishing a responsibility.
Example: To add an item in the shopping
cart, the InventoryDB object is contacted to
save the new contents of the shopping cart.
RegistrationPage
Responsibility Collaborators
Knows user name
Knows password
Knows RegistrationController
Handles click-event of RegistrationController
Submit button
Handle click Event (1)
We need to add the responsibility of
handling the registration request.
58
Example: Registration
object.
starts
with :
59
Step 3: Build State Chart
When the analysis class diagram, interaction
diagram, and CRC cards are completed during
the high level design, we can proceed to the
detailed level design.
61
How to build a state
diagram? (2)
When the class is involved in multiple use cases
62
Example:
Step 3: state diagram (1)
Data (attributes)
Operations
Public:
Public interface
Data (attributes)
Operations
Step 4: Class Design (1)
The designers and programmers of other
components will rely on the public interface
of a class any change of the public interface
will damage the work already done by other
designers.
Del_Item
Clear_cart
Check_out
Step 4: Identify parameters
and return values
What parameters are needed to invoke the operation.
customer
information (an
instance of
CustomerInfomati
on),
CRC card of SessionController (2)
shopping cart (a
list of
ProductInfo).
CRC card of SessionController (3)
SessionController
class can navigate to
CustomerInfoDB,
InventoryDB,
FinancialDeptWrap
per, and
ShippingDeptWrap
per. (include one
reference for each of
these wrapper
classes. )
Exercises: Detail design
of RegistrationController
RegistrationController
Private:
refCustomerInfoDB:object
refRegistrationPage:object
Public:
Register(username, password): String
Create_Reg_SuccessPage(): RegistrationSuccessPage
Create_Reg_FailurePage(): RegistrationFailurePage
Design Exercises
1. Use the noun extraction method to extract the
set of classes involved in the check out use case.
2. Develop the CRC card of the Inventory.
3. Design the sequence diagram for the check out
use case.
4. Design the state machine diagram for the
RegistrationController class.
5. Complete the design class diagram of the OPS
system.
CRC for LoginPage
LoginPage
Responsibility Collaborators
Knows username
Knows password
Knows SessionController
Handles click Login SessionController
88
CRC for Logout Page
Logout Page
Responsibility Collaborators
Knows SessionController
Handles click Logout SessionController
89
CRC for Checkout Page
Checkout Page
Responsibility Collaborators
Knows SessionController
Handles click Checkout SessionController
90
CRC for InventoryDB
InventoryDB
Responsibility Collaborators
Knows SessionController
Remove one item from stock Shoppingcart
Add all items to the stock Shoppingcart
91
CRC for CustomerInfoDB
CustomerInfoDB
Responsibility Collaborators
Knows SessionController,
RegistartionController
Create user account (user name, RegistartionController
password)
Knows customer infomation
Check valid user(user name, RegistartionController
password)
Save shopping cart Shoppingcart