Anda di halaman 1dari 31

Developing Class Diagrams

Approaches for developing class diagrams

1. Developing a class diagram from noun phrases


2. Developing a class diagram from using
abstraction
3. Developing a class diagram from use cases
Problem definition
“Developing a Library Checkout System”
An initial class diagram for library system
2) Developing a class diagram using
abstraction
2) Developing a class diagram from using abstraction

• Domain experts uses this approach.


• Several methods adopt this techniques:
a. In Object-oriented Analysis (Coad and yourdon )
b. In Object-oriented System Analysis (Shlaer and
Mellor method)
c. In Object oriented Development: the Fusion
method (coleman)
a) recommend set by Coad and yourdon

• In Object-oriented Analysis Coad and yourdon


recommend the following set:
– Are there are any kind-of or part-of relationship?
– With what devices will this system interact?
– With what other system will this system interact?
– What things or events must be remembered?
– What roles are played?
– What operational procedures exists in the system?
– What physical sites or organizational units exits?
b) Shlaer and Mellor method

In Object-oriented System Analysis, Shlaer and


Mellor offer a much shorter list of
identification keys.
• What tangible things exits?
• What roles are played?
• What events must be remembered?
• What interaction must be carried out?
c) Fusion method

• In Object oriented Development, coleman


recommend the following keys:
– What physical object exits?
– What people and organization involved?
– What abstraction are there?
E. g. of Developing a stock-Trading System
cont...
E. g. of Developing a stock-Trading System
cont...
E. g. of Developing a stock-Trading System
cont...
• Following are abstraction from Shlaer and
Mellor methods:
– Tangible things: Order, Account, stock
– Roles: Customer, Service representative
– Events: Stock Transfer, Cash Transfer
– Interactions: Match (of orders)
• Next,
need to consider each abstraction whether it
is a class and, if so, what attributes and
association it has.
E. g. of Developing a stock-Trading System
cont...
• Considering Order-
it's state information is as follows:
– An order number
– A type
– A status
– A stock name
– A number of shares
– A requested prize
– An optional expiration time
– A reference to account
E. g. of Developing a stock-Trading System
cont...

Figure : The Order class


E. g. of Developing a stock-Trading System
cont...
• Considering Account-
it's state information is as follows:
– An account number
– A cash portfolio
– A stock portfolio
– A customer
E. g. of Developing a stock-Trading System
cont...

Figure : Accounts, Stock holdings, and customer


E. g. of Developing a stock-Trading System
cont...
• Considering Service Representative
E. g. of Developing a stock-Trading System
cont...
• Considering abstraction stock and match
E. g. of Developing a stock-Trading System
cont...
3) Developing a class diagram from use cases
3) Developing a class diagram from use cases

• Determining the system use cases and actors and draw use case
diagram.

• Developing a use case diagram and class diagrams


– Increase the clarity of use case diagram by including directions.
– Now develop class diagram from use cases. To accomplish this,
• Describe each use case first by writing paragraph or stepwise
description or activity diagram or pre-condition, post
condition, triggers.
• Now“step through” each use case, adding enough to class
diagram (enhance your class diagram by describing further
use cases)
3) Developing a class diagram from use cases cont…

<<uses>>
Class diagram for order processing
Comparing, Combining Approaches
and Enhancing
• Benefits and drawbacks of above three
phrases
• Combining the three approaches
• Enhancing a model with specification.

Anda mungkin juga menyukai