Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1...

22
1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What is OOAD? How to do OOAD?

Transcript of Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1...

Page 1: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

1

Module 1: Introduction to OOAD

(Object-Oriented Analysis and Design)

�Why OO?

�What is OOAD?

�How to do OOAD?

Page 2: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

2

Why Object-Oriented?

Page 3: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

3

Why Object-Oriented?

Genesis 11:1-9 Acts

2:1-4

The Tower Of

Babel

Let's become famous

by building a city

with a tower that

reaches up to

heaven (verse

four).

Let's go down and

confuse their

speech right

away, and make it

so that they will

not understand

each other's

speech. (verses

five through

seven).

Page 4: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

4

What kind of language can alleviate difficulties with

communication & complexity?

Why Object-Oriented?

“The "software crises" came about when people realized the major

problems in software development were …

caused by communication

difficulties and the management of complexity”[Budd]

���

����ִ

What does the “mythical man-month”mean?

Page 5: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

5

Why Object-Oriented?

-concepts and objects

Study of a first grade class [Martin & Odell] [Novak, 1984, Cambridge University Press]

When given a list of concepts (water, salt water, Oceans, Penguins,...),

Harry constructed a concept diagramthrough which he understands his world and

communicates meaning

Do youunderstand what Harry understands?

Page 6: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

6

Why Object-Oriented?

…for Conceptual …ModelingReasons

What kind of language can be used to create this concept diagram,

or Harry’s m

ental image?

Water

Rivers

Oceans

Fish

PenguinsCrocodiles

Fresh water

Salt water

have

have

have

live in

have

have

Things, Relationships, Diagram

Page 7: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

7

Why Object-Oriented -> for Modeling

A model is a simplification of reality.

E.g., a miniature bridge for a real bridge to be built

Well...sort of…

.but not quite

A model is oursimplification of our perceptionof reality

To understand whya software system is needed, whatit should do, and howit should do it.

To communicate our understanding of why, what and how.

To detect commonalities and differences in your perception, my perception, his perception

and her perception of reality.

To detect misunderstandings and miscommunications.

Abstraction

Focus on the essential

Omits tremendous amount of details

…Focus on what an object “is and does”

Page 8: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

8

Whatis Object-Orientation?

-What is Object?

An "object" is anything to which a concept applies, in our awareness

Things drawn from the problem domain or solution space.

E.g., a living person in the problem domain, a software component in the solution space.

Page 9: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

9

What is Object-Orientation

-Classification -> Classes -> Instantiation

ClassCar

Attributes

�Model

�Location

�#Wheels = 4

Operations

�Start

�Accelerate

<<instanceOf>>

<<instanceOf>>

<<instanceOf>>

Encapsulation

CLASS

a collection of objects that share common properties, attributes, behavior and semantics, in general.

A collection of objects with the same data structure (attributes, state variables) and behavior (function/code/operations) in

the solution space.

Classification

Grouping of common objects into a class

Instantiation.

The act of creating an instance.

Page 10: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

10

What is Object-Orientation

-Subclass vs. Superclass

•Specialization:The act of defining one class as a refinement of another.

•Subclass:A class defined in terms of a specialization of a superclass

using inheritance.

•Superclass:A class serving as a base for inheritance in a class hierarchy

•Inheritance:Automatic duplication of superclass attribute and behavior

definitions in subclass.

What is generalization?

What is over-generalization?

multiple inheritance?

Person

name

SSN

Student

std-id

level

Employee

emp-id

age

Page 11: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

11

What is Object-Orientation

-Subclass vs. Superclass

A B C

A B

A B C

?

?

?

A B

b: B

<<instanceOf>>

<<instanceOf>>

A B

b: B

<<instanceOf>>

??

Page 12: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

12

What is Object-Orientation

-Polymorphism

Objects of different classes respond to the same message differently.

payTuition

Person

name

SSN

Student

std-id

level

Employee

emp-id

In-State

Student

state

payTuition

payTuition

Out-of-State

Student

payTuition

Page 13: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

13

What is Object-Orientation

-Interfaces

•Information hiding -all data should be hidden within a class, at least in principle.

•make all data attributes private

•provide public methods to get and set the data values (cf. Java design patterns)

•e.g. Grade information is usually confidential, hence it should be kept

private to the student. Access to the grade information should be

done through interfaces, such as setGradeand getGrade

payTuition

setGrade()

getGrade()

Student

std-id

level

getGrade

setGrade

grade

Page 14: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

14

What is Object-Orientation?

-States & State transitions

What is STATE?

"State" is a collection of association an object has with other objectsand object types.

What is STATE CHANGE?

A "state change" is the transitionof an object from one state to another.

What is EVENT?

An "event" is a noteworthy change in state [Rumbaugh]

tom: Actor

name = “Tom Cruise”

katie: Actor

name = “Katie Holmes”

tom: Actor

name = “Tom Holmes”

katie: Actor

name = “Katie Holmes”

married/

changeLastNam

e

tom: Actor

name = “Tom Holmes”

katie: Actor

name = “Katie Holmes”

suri: BabyActor

name = “Suri Holmes”

newArrival/

getName

Page 15: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

15

What is Object-Oriented Application?

•Collection of discrete objects, interacting w. each other

•Objects have propertyand behavior (causing state transition)

•Interactions through messagepassing

(A sender object sends a request (message) to another object(receiver)

to invoke a method of the receiver object’s)

Fn

Data

O1

Fn

Data

O2

Fn

Data

O3

m1

m2

m3

{m in Fn}

Page 16: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

16

What is OOAD?

Analysis

—understanding, finding and describing concepts in

the problem domain.

Design —

understanding and defining software

solution/objects that representthe analysis concepts and will

eventually be implemented in code.

OOAD —

Analysis is object-oriented and design is object-

oriented. A software development approach that emphasizes a

logical solution based on objects.

Traceability!

Page 17: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

17

How to do OOAD

-notation vs. process

UML is a notation.

So are English,

Elvish, Ku, …

But as yet I can’t

Page 18: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

18

Systems Engineering

Requirements Analysis

Project Planning

Architectural Design

Detailed Design

Implementation

Release

Maintenance

Quality Assurance

Software Lifecycle

How to Do OOAD

–Where to Use OO?

Traceability!

Something missing?

What’s yours like?

Page 19: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

19

Introductionto OOAD -Summary

Why

Once Software Crisis due to Communication and Complexity

OO for Conceptual Modeling

What

Fundamental OO Concepts

A little taste of UML

How

OO development processes & (Design) Patterns

Page 20: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

20

Points to Ponder

What are the most important concepts in your project?

What are the most important concepts in your

program?

Can you reverse engineer a design, DD and HLD?

What are the most important concepts in your design?

What are the most important concepts in your PRS,

PAS, PDS?

Page 21: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

21

How to Do OOAD

–One Good Way: Use (OO) Design Patterns

Reusable solutions to typical problems.

“Each design pattern systematically names, explains, and evaluates an

important and recurring design in object-oriented systems.”[Gamma]

Name —

identifies a particular pattern, creating a vocabulary.

Problem

—identifies context when pattern should be applied.

Solution—an abstract description of a design problem along with a template

object design that solves the problem.

Consequences—results and trade-offs of applying the pattern.

Page 22: Module 1: Introduction to OOAD - University of Texas at Dallaschung/Fujitsu/M01_OO_Intro.pdf · 1 Module 1: Introduction to OOAD (Object-Oriented Analysis and Design) Why OO? What

22

How to Do OOAD

-OO Development Processes

Fusion

Hewlett Packard

Recommended Process and Models

ObjectSpacebest practices

Larman’sexperiences

The Rational Unified Process (RUP)

Rational; Booch, Jacobson, and Rumbaugh

Some Popular OOAD Processes (for reference only)