Software Engineering Zhang Shuang zhangs@swc.neu.edu.cn

Preview:

Citation preview

Software Engineering

Zhang Shuang

zhangs@swc.neu.edu.cn

Object-Oriented Design (OOD)

Aim Design product in terms of objects

extracted during OOA

Object-Oriented Design Steps

OOD consists of four steps:

1. Construct interaction diagrams.

The designer creates a sequence diagram or a

collaboration diagram for each of the use case

scenarios defined during the analysis phase.

Object-Oriented Design Steps

OOD consists of four steps:

2. Construct a detailed class diagram.

The preliminary class diagram created during the

analysis phase is elaborated to include a full list of

methods (including their signatures and return

types) and data members (including their types).

Additional classes and relationships are added

where necessary.

Object-Oriented Design Steps

OOD consists of four steps:

3. Construct a client-object relation diagram.

The designer then arranges the classes in a

diagram that emphasizes their hierarchical

relationship; this corresponds to the motion of a

control flow diagram (CFD) in structured analysis.

Object-Oriented Design Steps

OOD consists of four steps:

4. Complete a detailed design.

The designer then specifies the algorithms to be

implemented for each method, along with the

internal variables and data structures required by

each method.

Object-Oriented Design Steps

One of the main activities of software design is to partition the functionalities identified in the requirements specification and analysis phases into specific software modules.

Module In traditional structured programming, a

particular function or program in a particular language.

In object-oriented programming, an object, or perhaps a method associated with a particular object.

Elevator Problem: OOD

Step 1. Construct interaction diagrams for each scenario Sequence diagrams Collaboration diagrams

Comparison Both show the same thing Objects and messages passed between

them But in a different way

Normal scenario

Sequence Diagram

object1:C1

Sel f-cal l ing

oper()

Sequence Diagram

object1:C1 object2:C2

[x>y] message1()

[el se] message2()

Guard-condi tion expression

Sequence Diagram

object1:C1 object2:C2

[for al l order l ines] message1()

[i := 1..n] message2()

Loop expression

Sequence Diagram

object1 object2

m1()

m2()

Loop expression

[for al l order l ines]

[i := 1..n]

Sequence Diagram

object1:C1 object2:C2

Oper1()

Oper2(x, y)

:C3

[condi tion1] Oper3()

Case Study: Sequence Diagram

Use case scenario:

Login

Elevator Problem: OOD (contd)

Collaboration diagram

Zhang Shuang, zhangs914@163.com

Recommended