object oriented software engineering

34
1 t. of Computing Systems, Uppsala University, 1999 on H. Eden Object Oriented Software Object Oriented Software Engineering Engineering Abstraction Phases Lifecycle Models

Upload: fabian

Post on 14-Jan-2016

38 views

Category:

Documents


4 download

DESCRIPTION

Object Oriented Software Engineering. Abstraction Phases Lifecycle Models. Abstraction. The OOP Fundamental:. By looking at the problems of software engineering: Low understandability Fragility Redundancy Complexity Unreliability … - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Object Oriented Software Engineering

1

Dept. of Computing Systems, Uppsala University, 1999

Amnon H. Eden

Object Oriented Software Object Oriented Software EngineeringEngineering

Abstraction Phases Lifecycle Models

Page 2: Object Oriented Software Engineering

2

Dept. of Computing Systems, Uppsala University, 1999

Amnon H. Eden

AbstractionAbstraction

Page 3: Object Oriented Software Engineering

3

Lack Of Abstraction!

By looking at the problems of software engineering:– Low understandability

– Fragility

– Redundancy

– Complexity

– Unreliability

We Conclude that the fundamental problem can be described as --

The OOP Fundamental:The OOP Fundamental:

Page 4: Object Oriented Software Engineering

4

AbstractionAbstraction: What does it : What does it mean?mean? 1. “Human”-like reasoning

– Higher-level concepts• Examples: Vehicle (general), initialization (automatic),

modularity (support in logical vs. physical)

– … as opposed to Machine concepts:• Memory, pointer, file, B-tree, ...

2. Distinguish essence from detail– Interface vs. Implementation

– What vs. How

– Analysis vs. Design

Page 5: Object Oriented Software Engineering

5

OOP = Abstraction TechniquesOOP = Abstraction Techniques

Encapsulation– Support logical modularity

Information Hiding– Distinguish interface from implementation

Inheritance– Support hierarchical abstractions

Polymorphism– Same source code applies to many types

Page 6: Object Oriented Software Engineering

6

Which Abstractions Are Necessary?Which Abstractions Are Necessary?

Common abstractions– Window

• open, move, minimize, close …

– A data structure• Insert, remove, find, sort …

– File• open, close, read, write, goto-offset(size), …

– 3D object• rotate, color, combine …

– Processed data report• sort_by_column, column_contents, compute_column, …

– …

Page 7: Object Oriented Software Engineering

7

How to Achieve Abstraction I: How to Achieve Abstraction I:

Enlarge The LanguageEnlarge The Language

Add the abstractions to the language!– Create a version of the language for each domain:

• For manipulating GUI• For creating monetary reports• For managing data structures• For manipulating files• …

– Drawbacks:• restricted to a specific domain• Inefficient

– Reason: Adding words complicates the language!

Page 8: Object Oriented Software Engineering

8

How to Achieve Abstraction II: How to Achieve Abstraction II:

Special Purpose LanguagesSpecial Purpose Languages

Application generators– Magic

Target-specific languages– GUI generators

• GUPTA, Power-Builder, Visual Basic, Magic, ...

– Database managers• Arrive along with a database: Access, Oracle, ...

4th Generation Languages– Specification languages

• Z, Larch

Page 9: Object Oriented Software Engineering

9

How to Achieve Abstraction III:How to Achieve Abstraction III: OOP OOP

The general solution:

A language for generating abstractions!

Abstractions In OOP: Human concepts are translated to objects, their relations may stand for

relations in the human model

Page 10: Object Oriented Software Engineering

10

Dept. of Computing Systems, Uppsala University, 1999

Amnon H. Eden

Phases in O-O Software DevelopmentPhases in O-O Software Development

Analysis Design Implementation

Page 11: Object Oriented Software Engineering

11

Activities in Software EvolutionActivities in Software Evolution

Requirement Specification– Architectural specification– Prototyping

Development– Analysis– Design– Implementation

• Coding• Integration

Validation– Testing– Verification

Maintenance– Debugging– Adaptation to clients’ requirements– Adaptation to changes in hardware

Page 12: Object Oriented Software Engineering

12

Distinguish Analysis from Design!Distinguish Analysis from Design!

Analysis Design

purpose what how

activity analysis synthesis

products problemconcepts

artifacts ofthe solution

Page 13: Object Oriented Software Engineering

13

“The goal of the analysis is to fully specify the problem and the application domain without introducing a bias to any particular implementation.” (Rumbaugh et. at, p.187)

Analysis Phase: PurposeAnalysis Phase: Purpose

Page 14: Object Oriented Software Engineering

14

Object Oriented AnalysisObject Oriented Analysis

Provide a rigorous model of the system’s behavior– Rephrase the requirements using O-O concepts:

• Classes

• Objects

• Inheritance

• Composition

• etc. Remember: Relate only to the problem domain!

Page 15: Object Oriented Software Engineering

15

OOA formalizes the requirements specification into OOP terminology:

Object Oriented Analysis

Requirements Specification

MethodMethod

words, sketches, informal

diagrams

Object Oriented Design

classes, objects, relations

Page 16: Object Oriented Software Engineering

16

OO Analysis & Design TechniquesOO Analysis & Design Techniques

Use CasesFactoring“Nouns and Verbs”CRC CardsStoryboard Scenario: Example 2Data Dictionary

Page 17: Object Oriented Software Engineering

17

A High Level of AbstractionA High Level of Abstraction

Simulate the problem domain– Purpose: Increase understandably and maintainability

of the system– Relevant relations and agents must appear in the

model• Types and relations are implied by the problem• Examples: student, transaction, engine, abstract data types

(list, set, etc.), mathematical expressions

– Artifacts of solutions are not allowed!• Examples: OS terms, memory management, interrupts,

concrete data structures (linked list, vector, etc.)

Page 18: Object Oriented Software Engineering

18

OOA: The AdvantageOOA: The Advantage

As abstraction is the main concern we achieve --– A better language for modeling the problem

domain (the requirements)• Classes, objects, and messages: Close to human

concepts

– Smooth transition to the implementation• Classes, objects, and message: Supported by the

programming language

Page 19: Object Oriented Software Engineering

19

Object Oriented DesignObject Oriented Design

Design the artifacts required in the implementation of the system– Carry out the analysis– Focus on the solution domain– Produce “complete” specification– Introduce previously ignored considerations of:

• Performance• Reliability • Security• Persistence

Page 20: Object Oriented Software Engineering

20

ProductsProducts

A complete specification of the system– Architecture: Modules, libraries, directories, …

– Software and hardware configuration• Network, protocols, file system, database, …

Finalize development decisions– Development tools and environment

• Programming language, compiler, debugger, class libraries

– Project management until delivery• E.g., Configuration management

– Global design decisions• Exception handling, persistence, built-in quality measures

Page 21: Object Oriented Software Engineering

21

Directions of Design ProgressDirections of Design Progress

“Top Down”– Recursively partition the problem into sub-problems

until tractable sub-problems are defined

“Bottom Up”– Begin with known solutions and existing resources

and adapt them to match the problems

Page 22: Object Oriented Software Engineering

22

OOD TechniquesOOD Techniques

Most of the techniques used for the analysis can be used during the design phase:– Factoring, merging, and splitting classes– CRC specifications– Storyboard scenarios– Sketch Class, object, interaction, and state diagram

Page 23: Object Oriented Software Engineering

23

Dept. of Computing Systems, Uppsala University, 1999

Amnon H. Eden

Lifecycle ModelsLifecycle Models

Page 24: Object Oriented Software Engineering

24

The Waterfall ModelThe Waterfall Model

– W. Royce 1970

Linear order of phases

For each phase:– Input

– Process

– Output

Page 25: Object Oriented Software Engineering

25

RequirementsSpecification

Analysis

Design

Implementation

Testing

Maintenance

The Waterfall Model: The Waterfall Model: CorrectionCorrection

The waterfall model is based on the assumption that humans don’t make mistakes

It designates as an ideal that is never true

Feedback is a must:

Page 26: Object Oriented Software Engineering

26

Pros of the Waterfall modelPros of the Waterfall model

Think, then implement:– Analysis– Design

“The only possible model”– All steps are essential

• No “documentation step”

– Order is the only logical one!• Any reasonable alternative

Page 27: Object Oriented Software Engineering

27

Cons of the Waterfall modelCons of the Waterfall model

Changes that go back more than one stage!– E.g., flaws in the requirements can surface during design

Assumes synchronous progress:– The integration nightmare!

No support for continuos maintenance– 60%-80% of software cost

Huge risk factor: code shows up very late– Stubborn bugs

– Unexpected performance bottlenecks

– Dangerous hidden assumptions in design

– Need for unavailable external factors and resources

Page 28: Object Oriented Software Engineering

28

The Spiral ModelThe Spiral Model

B. Boehm 1988

Multiple iterations– Iterations stand for

reduced abstraction – Each iteration:

• Analyze results of previous cycle

• Determine risk• Build a prototype

Analysis

Design

Implementation

Validation

Page 29: Object Oriented Software Engineering

29

The “Rational” Model (Booch)The “Rational” Model (Booch)

Booch 1990

Macro process– Identical to the Waterfall model

Micro process– Four iterative stages– No “starting point”

Identify classesand objects

Specify class/object interface &Implementation

Identify class/object semantics

identify class/object relationship

Page 30: Object Oriented Software Engineering

30

Graham I. M. 1995

Develop each component separately

– Non-deterministic progression order between activities

– Each activity has pre- and post-conditions

OPEN ModelOPEN Model

Page 31: Object Oriented Software Engineering

31

Project vs. Component Project vs. Component DevelopmentDevelopment

OUTCOME: results

UNIT: project

ECONOMICS: Profit

TIME: short-term

BRICKS: program

elements

STRATEGY: Top-

down

OUTCOME: tools, libraries

UNIT: department, company, industry

ECONOMICS: investment

TIME: long-term BRICKS: software

components STRATEGY: bottom-up

Page 32: Object Oriented Software Engineering

32

Components: Add Generalization StageComponents: Add Generalization Stage

During the generalization stage:– Make it right

– Make it fast

– Make it small

– Make it better

– Make it general

Resist the temptation to:– Over specialize

– Tweak performance Generalization

Implementation

Design

Analysis

Single Product

Page 33: Object Oriented Software Engineering

33

Component Model: SummaryComponent Model: Summary

Pros:– Early feedback to customers– Incremental customer transition to new system– Early integration– Better distribution of testing resources– Improve team morale and motivation:

• Working system at hand

– Ease integration

Cons:– What is a component?

Page 34: Object Oriented Software Engineering

34

FeasibilityStudy

Division into

Clusters

ProjectTime

ProjectTime

G

I

D

A

G

I

D

A

G

I

D

A

G

I

D

A

The Component Life Cycle The Component Life Cycle ModelModel