Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Object-Oriented Analysis and Design (OOAD)

IMSE1013
Henry Lau

Object-Orientation?
What is ObjectObject-Orientation & ObjectObjectOriented (OO) Methods? (C++, Java, Oracle??) What is OO methods used for? What are the features of OO methods? How are they different from SSADM?

Intro to IS - OOAD

Object-Oriented Methods
A technique for system modelling A technique to manage complexity inherent in
analysis, design, and implementation For the analysis and design of system Provide integrated view of hardware and software Provide a methodology for system development
Intro to IS - OOAD 3

How? Using object-orientation as a base, we model a system as a number of objects that interacts.

Intro to IS - OOAD

Is It Any Good?

A system which is designed and modelled using an objectobject-oriented technology is: Easy to understand Directly related to reality - semantic gap Natural partitioning of the problem More flexible and resilient to change Systems can be developed more rapidly and at a lower cost
Intro to IS - OOAD 5

Some Qualities of OO
Understanding of system is enhanced, as
the semantic gap is reduced Modification to the model tend to be local as they often result from an individual item, which is represented by a single object Ideally suited to model real systems, and simulating systems
Intro to IS - OOAD 6

Some Examples of Using OO


Object technology is key to rere-engineering
business process at Xerox Space telescope uses OO technology and Booch Method to build interface to Hubble Database British Airways choose OO tools for airline applications

OO Methods
ObjectObject-Oriented Design (OOD) - Booch (1983),
pioneering but not quite scalable ObjectObject-Oriented System Analysis (OOSA) Shlaer & Mellor (1988), essentially information analysis based on data modelling ObjectObject-Oriented Analysis (OOA) - Coad & Yourdon (1991), a method for developing OO system model

Intro to IS - OOAD

Intro to IS - OOAD

OO Methods (cont.)
Object Modelling Technique (OMT) Rumbaugh et al. (1991), entity/relationship modelling with extension to model classes, inheritance and behaviour Hierarchical ObjectObject-Oriented Design (HOOD) - ESA (1989), architectural design for Ada code

OO Methods (cont.)
Jacobson Use Case - Jacobson et al.
(1992), requirement modelling, modelling, analysis and design; also known as OOSE Unified Modelling Language (UML) Booch, Booch, Rumbaugh, Rumbaugh, Jacobson (1997/2000), a method that provides a united OO approach to system development
Intro to IS - OOAD 10

Intro to IS - OOAD

Object-Oriented Modelling
Attach the behaviour and information
that is important to objects Associate relations between object to describe the static and dynamic organisation and structure of real situation

OO Modelling

Next to Tree House Live in Drives Car

Henry

Intro to IS - OOAD

11

Intro to IS - OOAD

12

The Basics
Objects Classes Relationships An Instance Idea of encapsulation

An Object
Some concept of reality A physical entity It is characterised by:
a number of operations, a state which remembers the effect of these operations

Intro to IS - OOAD

13

Intro to IS - OOAD

14

An Object
Operations:
Work Dance Drive Jump Height Eye colour Hair colour Weight
15

Relationships
Static:
relations existing over a long time objects know about each other existence

Attributes:

Dynamic:
relations which two objects communicate with each other object sending stimuli to other stimuli - events, messages

Intro to IS - OOAD

Intro to IS - OOAD

16

Consist of Relation Is a Relation

Intro to IS - OOAD

17

Intro to IS - OOAD

18

Creating Objects
Composition - structure object from
parts Partition - into hierarchy (is a) Consist of - build objects from others Aggregate - to join together (has a)

Encapsulation
A concept of SelfSelf-containing containing Information hiding - internal internal structure is
hidden from their surroundings Behaviour and information is represented or implemented internally Functionality and behaviour characterised by interfacing operations
Intro to IS - OOAD 20

Intro to IS - OOAD

19

Class
A class represents a template for several
objects and describes how these objects are structured internally Objects of the same class have the same definition both for their operations and their information structure Class is an implementation of objects

Instance
An instance is an object created from a
class A class describes the behaviour and information structure of an instance, while the current state of the instance is defined by the operations performed on the instance System Systems behaviour is performed via the interactions between instances
21 Intro to IS - OOAD 22

Intro to IS - OOAD

Key Concepts

Polymorphism
A concept in type theory A common name may denote instances
of different classes One type of operation can be implemented in different ways by different classes

Polymorphism same object has


different implementations Inheritance to adopt, permutate, and derive from some generic objects

Overloading in modern OO language

Intro to IS - OOAD

23

Intro to IS - OOAD

24

Why Polymorphism
A very strong tool for allowing system
designers to develop flexible systems Designer only need to specify what shall occur and not how it shall occur To add an object, the modification will only affect the new object, not those using it

Inheritance
If class B inherits class A, then both operations and the information structure described in class A will become part of class B

Intro to IS - OOAD

25

Intro to IS - OOAD

26

Inheritance
Mannal

Why Inheritance?
Show similarities Reuse common descriptions Software Reuse Reuse Easy modification of model by performing
modification in one place Avoid redundancy, leading to smaller and more efficient model, easier to understand
27 Intro to IS - OOAD 28

Man

Dog

soldier

navy

Intro to IS - OOAD

Limitations of SSADM
Treat data and function separately
function/data oriented method More suited to classical hardware More difficult to maintain and rere-configure Method require more abstraction - not too natural Large semantic gap between external and internal view of a system

Object-Oriented Methods
Advocate integral objects which encapsulate
both function and data

Main activities include:


Identification of objects, and Analysing their behaviour and information

Uses objectobject-oriented techniques and ideas:


inheritance polymorphism function/data abstraction

Intro to IS - OOAD

29

Intro to IS - OOAD

30

Object-Oriented Analysis & Design


1. Finding objects 2. Organising objects 3. Describing how objects interacts 4. Defining the operations of objects 5. Defining objects internally
Intro to IS - OOAD 31

Finding Objects

Naturally occurring entities - physical A concept of some abstract ideas - conceptual Should be stable Classes of objects
active/passive temporary/permanent/persistent part/whole generic/specific private/public

Intro to IS - OOAD

32

Object-Oriented Design
The objects found are to be implemented Once objects for a system are identified, they
are refined, organised and related Classes that define the implementation are structured and consolidated Classes are refined with implementation details (e.g. OS, language, hardware, etc.) Classes are coded

Organising Objects
Classification Similar objects - inheritance: is a Interactions/relationships between objects Whole/Part relationship: has a

Intro to IS - OOAD

33

Intro to IS - OOAD

34

Object Interactions
Identify how objects fit into a system Use of scenarios - unique situations Objects Objects communication Objects Objects interfaces Refined relationships

Objects Functionality
Operations performed by an object Behaviour of an object Specification of interfaces, external and
internal functions Objects with complex functionality should be partitioned into simpler objects

Intro to IS - OOAD

35

Intro to IS - OOAD

36

Object Implementation
The specification of CLASSES Define information that an object
encapsulates - ATTRIBUTES and METHODS

Object Implementation
METHODS:
Specify external functions Specify internal functions that are not seen or usable by others objects

Automobile Colour Made Travel SoundHorn OpenSunRoof

Languages: C++, Smalltalk, Ada,


Eiffel, Modula-2, Simula, Java++

Intro to IS - OOAD

37

Intro to IS - OOAD

38

Testing of Objects
Similar to SSADM Unit/Integration/System tests Validation and verification
1. Cross references 2. Object diagrams 3. Simulation of classes

OO Methods - Some Advantages


Reduce semantic gap between domain
(the actual) and model (the design) Closer to reality e.g. classification of objects close to how human understand surroundings Easier to understand and maintain Easier to modify (e.g. polymorphism)
39 Intro to IS - OOAD 40

Intro to IS - OOAD

The Jacobson Use Case Method

Jacobson Use Case Method

An OO methodology that emphases on


the identification of objects - requirement analysis Based on 3 techniques:
1. Conceptual modeling 2. Block design 3. ObjectObject-oriented programming

(OOSE)
Intro to IS - OOAD 41

Intro to IS - OOAD

42

Model Building with JM

Jacobson Method
The development cycle is organized into
five models:
1. 2. 3. 4. 5. Requirement model Analysis model Design model Implementation model Test model

ANALYSIS

CONSTRUCTION

TEST Test Model

Requirement Model Design Model Analysis Model Implementation Model

Intro to IS - OOAD

43

Intro to IS - OOAD

44

System Development
Requirement (Use Case) Model

Requirement Model
Capture the functional and nonnon-functional
requirements Formalize the requirement Identify and document essential system entities Identify and document essential system behaviors
45 Intro to IS - OOAD 46

Structured by

Realised by

Implemented by

Tested in

Classes

OK OK Failed

Analysis Model

Design Model

Implementation Model

Test Model

Intro to IS - OOAD

Requirement Use Case Model


uses uses

Requirement Model
Actors:
Actor3

Actor1

Use Case1

Use Case2

uses

Actor1
System

Essential system entities from an user view point Interacts with system Changes system behavior Control system functionality

Actor2
Intro to IS - OOAD 47 Intro to IS - OOAD 48

Requirement Model
System - define the
Use Case1

Analysis Model
Structure a system
Data2

boundary Use Cases:


System scenarios System behaviors Unique transaction between actors and the system User point of view
Interface1

Control1

Use Case2

System

Data1 Interface2

independently to the actual implementation Capture information, behavior and presentation Specify objects

Intro to IS - OOAD

49

Intro to IS - OOAD

50

Design Model
Refine the object structure to the chosen
implementation environment Objects are consolidated into blocks abstracted classes Blocks interactions are also documented using interaction diagrams

Implementation Model
The blocks in the design model are
implemented using classes Class diagrams are used to express relationships between classes Class specifications Annotated source code (pseudo(pseudo-code) for methods and attributes of classes
51 Intro to IS - OOAD 52

Intro to IS - OOAD

Class Diagrams - Inheritance


Class A Type CheckStatus() persistent

Class Diagram - Aggregation


Class A Type CheckStatus() persistent
1

'has a'

Class B Type
1..N 1

CheckStatus GenerateReport() persistent

Class C

Class D

Intro to IS - OOAD

53

Intro to IS - OOAD

54

Class Diagram - Uses


Class A Type CheckStatus() persistent
1

Class Diagram - An Example


GUI
0..N

FMC

Workstation

1 1

0..N

GUI
Robot

Mechine Centre

NC Machine

Intro to IS - OOAD

55

Intro to IS - OOAD

56

Object Diagrams
GUI

Test Model
States the method and result of testing Test specification describe how classes

1: Load NC Program 2: Start checking 4: Ready to Operate

3: Status OK
L Machine Centre A

and system are to be tested Test results document outcome of the tests executed Verification and validation

Intro to IS - OOAD

57

Intro to IS - OOAD

58

System Analysis and Design with Jacobson


1. Requirement Analysis 2. Functional Analysis and Design

Requirement Analysis
Generate requirement model with actors,
and use cases identified STEP 1: System context diagram STEP 2: Identify principal actors (external and internal) STEP 3: Construct use cases STEP 4: Represent actors and use cases with a use case actor diagram

Intro to IS - OOAD

59

Intro to IS - OOAD

60

Functional Analysis & Design


Structure system functionality into objects To distribute the behavior of the use cases
among objects - analysis model Create objects that are common to actors or use cases Identify the responsibilities of objects Identify the relationships between objects

Analysis and Design


STEP 1: Identify scenarios from use cases STEP 2: Associate actors and use cases to
scenarios STEP 3: Produce event lists for scenarios STEP 4: Identify primary object types STEP 5: Consolidate objects into control, entity and interface STEP 6: Identify and represent relationships
Intro to IS - OOAD 62

Intro to IS - OOAD

61

Forces in Software

Unified Modeling Language (UML)

Functionality Cost Capacity Availability Compatibility Fail safe Fault tolerance

Performance Technology

Throughput Resilience

The challenge over the next 20 years will not be speed or cost or performance; it will be a question of complexity.
Bill Raduchel, Chief Strategy Officer, Sun Microsystems

Our enemy is complexity, and its our goal to kill it.


Intro to IS - OOAD 63

Jan Baan

Intro to IS - OOAD

64

The Value of UML


Is an open standard Supports the entire software development
lifecycle Supports diverse applications areas Is based on experience and needs of the user community Supported by many tools
Intro to IS - OOAD 65

History of UML
UML 1.3
OMG Acceptance, Nov 1997 Final submission to OMG, Sep 97 public feedback First submission to OMG, Jan 97 UML partners Web - June 96

UML 1.1 UML 1.0 UML 0.9

OOPSLA 95

Unified Method 0.8

Other methods

Booch method
Intro to IS - OOAD

OMT

OOSE
66

Overview of the UML


The UML is a language for
visualizing specifying constructing documenting

A model is a complete description of a system from a particular perspective


Use Case Use Case Diagrams Sequence Diagrams Diagrams

Graphical Tools
Use Case Use Case Diagrams Use Case Diagrams Diagrams State State Diagrams Class Diagrams Diagrams State State Diagrams Object Diagrams Diagrams

the artifacts of a softwaresoftware-intensive system

Scenario Scenario Diagrams Collaboration Diagrams Diagrams

Models

State State Diagrams Component Diagrams Diagrams

Scenario Scenario Diagrams Statechart Diagrams Diagrams


Intro to IS - OOAD 67

Component Component Diagrams Deployment Diagrams

Activity Diagrams
Intro to IS - OOAD

Diagrams

68

You might also like