Sie sind auf Seite 1von 29

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

Isolating the noun phrases


You, code, checkout duties, library,
library member, book, video, system,
member
Item number, clerk, book status,
video status, title, author
Library card, membership number,
borrower, borrower book, borrower
video, overdue book, overdue video,
loan condition, due date

Elimination criteria

A candidate class is redundant


A candidate class is irrelevant
The candidate class is vague
The candidate class is an attribute
The candidate class is an operation
The candidate class describes a role
The candidate class represents an
implementation construct

Applying criteria
Redundant classes: System, Member
Irrelevant classes: You, Code, Library Card
Classes represents attributes: Item Number,
Book Status, Video Status, Title, Author,
Membership Number, Due Date
Operation class: Checkout Duties
Classes describe roles: Borrower, Borrower
Book and Borrower Video, Overdue Book
and Overdue Video
In such a way, after applying elimination
criteria, remaining classes will come in class
diagram.
Several attributes will also been identified
during this process.

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 other system will this system
interact?
With what devices 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...
Following are abstraction from Shlaer
and Mellor methods:
Tangible things: Account, Order, 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 Accountit'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 Orderit'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 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
Developing a use case and class
diagrams
Increase the clarity of use case diagram by
including directions.
Now develop class diagram from use cases.
To accomplish this, step through each use
case, adding enough to class diagram

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
paragrapg or stepwise description or activity
diagram or pre-condition, post condition,
triggers.
Nowstep 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>>

3) Developing a class diagram from use


cases cont...

To develop a class diagram from use cases. To


accomplish this, step through each use case,
adding enough to class diagram

Describe Place order use case


The customer places a order for one or
more catalog items
The order is entered in the system after it is
funded
Each order item is allocated from available
inventory

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.

Das könnte Ihnen auch gefallen