Object Oriented Software techniques

48
Software Architecture : Why Distributed Object Oriented Programming ?

description

 

Transcript of Object Oriented Software techniques

Page 1: Object Oriented Software techniques

Software Architecture :

Why Distributed Object Oriented Programming ?

Page 2: Object Oriented Software techniques

2 © Emmanuel FUCHS.© Emmanuel FUCHS. THALES ATM

Distributed Object Programming

� Raising abstraction

� Object Programming

� Programming for changes

� Programming in future tense

� Programming for reuse

� Programming by interface

� Letting old code calling new code

� Polymorphism and dynamic binding

Page 3: Object Oriented Software techniques

3 © Emmanuel FUCHS.© Emmanuel FUCHS. THALES ATM

Distributed Object Programming

� Raising abstraction

� Object Programming

� Programming for changes

� Programming in future tense

� Programming for reuse

� Programming by interface

� Letting old code calling new code

� Polymorphism and dynamic binding

Page 4: Object Oriented Software techniques

4 © Emmanuel FUCHS.

Raise abstraction means:

� Encapsulation

� Layering

� Interface

� Object Programming techniques

Page 5: Object Oriented Software techniques

5 © Emmanuel FUCHS.

Middleware

Middleware

Network

Hardware

Network

Hardware

Operating System Operating System

Application ApplicationInterface

Page 6: Object Oriented Software techniques

6 © Emmanuel FUCHS.

Middleware

Middleware

Network

Hardware

Network

Hardware

Operating System Operating System

Application Application

Object API Object API

Framework

Page 7: Object Oriented Software techniques

7 © Emmanuel FUCHS.

Middleware

� Low level middleware:

� Message Passing : spaghetti plate syndrome

� RPC : no evolution

� Object middleware:

� Transparent integration

� Transparent reuse

Page 8: Object Oriented Software techniques

8 © Emmanuel FUCHS.© Emmanuel FUCHS. THALES ATM

Distributed Object Programming

� Raising abstraction

� Object Programming

� Programming for changes

� Programming in future tense

� Programming for reuse

� Programming by interface

� Letting old code calling new code

� Polymorphism and dynamic binding

Page 9: Object Oriented Software techniques

9 © Emmanuel FUCHS.

Object figures

� Encapsulation.

� Interfaces.

� Inheritance.

� Polymorphism. (dynamic binding)

� Exception handling.

Page 10: Object Oriented Software techniques

10 © Emmanuel FUCHS.© Emmanuel FUCHS. THALES ATM

Distributed Object Programming

� Raising abstraction

� Object Programming

� Programming for changes

� Programming in future tense

� Programming for reuse

� Programming by interface

� Letting old code calling new code

� Polymorphism and dynamic binding

Page 11: Object Oriented Software techniques

11 © Emmanuel FUCHS.

program in the future tense.

1 Day After

1 Week After

Initial Request

Future tenseprogramming

Page 12: Object Oriented Software techniques

12 © Emmanuel FUCHS.

program in the future tense.

1 Day After

1 Week After

Few Weeks Later

1 Day After

Initial Request Evolution Request

Page 13: Object Oriented Software techniques

13 © Emmanuel FUCHS.

Changes Sources During Development

� Requirements :

� Customers Discover What they Really Want During or at the End of Developments

� Technology

� Performances Are Increasing With Time

� Skill

� We Learn and Understand the Problem and We Discover the Right Solution on the Job

� Politic

� No Comments

Page 14: Object Oriented Software techniques

14 © Emmanuel FUCHS.© Emmanuel FUCHS. THALES ATM

Distributed Object Programming

� Raising abstraction

� Object Programming

� Programming for changes

� Programming in future tense

� Programming for reuse

� Programming by interface

� Letting old code calling new code

� Polymorphism and dynamic binding

Page 15: Object Oriented Software techniques

15 © Emmanuel FUCHS.

Programming in “present” tense

x

y

Page 16: Object Oriented Software techniques

16 © Emmanuel FUCHS.

Programming in “present” tense

Point

+print()

# int x# int y

ClientPrint()

x

y

Page 17: Object Oriented Software techniques

17 © Emmanuel FUCHS.

Future

Point

+print()

# int x# int y

ClientPrint()

x

yz

Page 18: Object Oriented Software techniques

18 © Emmanuel FUCHS.

Future

Point

+print()

# int x# int y

ClientPrint()

x

yz

Page 19: Object Oriented Software techniques

19 © Emmanuel FUCHS.

Programming in “Future” tense

Point

+print()

# int x# int y

3DPoint

+ print()

# int z

ClientPrint()

x

yz

Page 20: Object Oriented Software techniques

20 © Emmanuel FUCHS.

Programming in “Future” tense

Point

+print()

# int x# int y

3DPoint

+ print()

# int z

ClientPrint()

x

y

θθθθ

ρρρρz

Page 21: Object Oriented Software techniques

21 © Emmanuel FUCHS.

Programming in “Future” tense

<<Interface>>Point

+print()

3DPoint

+ print()

ClientPrint()

x

y

θθθθ

ρρρρz

Page 22: Object Oriented Software techniques

22 © Emmanuel FUCHS.

Inheritance and polymorphism

Point

+print()

1DPoint

+ print()

ClientPrint()

Page 23: Object Oriented Software techniques

23 © Emmanuel FUCHS.

Inheritance and polymorphism

Point

+print()

1DPoint

+ print()

ClientPrint()

2DPoint

+ print()

Page 24: Object Oriented Software techniques

24 © Emmanuel FUCHS.

Inheritance and polymorphism

Point

+print()

1DPoint

+ print()

ClientPrint()

2DPoint

+ print()

3DPoint

+ print()

Page 25: Object Oriented Software techniques

25 © Emmanuel FUCHS.

Inheritance and polymorphism

Point

+print()

1DPoint

+ print()

ClientPrint()

2DPoint

+ print()

3DPoint

+ print()

NDPoint

+ print()

Teleportation

Page 26: Object Oriented Software techniques

26 © Emmanuel FUCHS.

Inheritance and polymorphism

<<Interface>>Point

+print()

1DPoint

+ print()

ClientPrint()

2DPoint

+ print()

3DPoint

+ print()

NDPoint

+ print()

Teleportation

Page 27: Object Oriented Software techniques

27 © Emmanuel FUCHS.© Emmanuel FUCHS. THALES ATM

Distributed Object Programming

� Raising abstraction

� Object Programming

� Programming for changes

� Programming in future tense

� Programming for reuse

� Programming by interface

� Letting old code calling new code

� Polymorphism and dynamic binding

Page 28: Object Oriented Software techniques

28 © Emmanuel FUCHS.

Objective-C analogy

Class Object

Page 29: Object Oriented Software techniques

29 © Emmanuel FUCHS.

Implementation Interface

A driver doesn't care of engine's internal working.He only knows the interface

Object Car analogy

Page 30: Object Oriented Software techniques

30 © Emmanuel FUCHS.

A driver doesn't care of engine's internal working.He only knows the interface

Object analogy

Implementation Interface

Page 31: Object Oriented Software techniques

31 © Emmanuel FUCHS.

A driver doesn't care of engine's internal working.He only knows the interface

Object analogy

Implementation Interface

Page 32: Object Oriented Software techniques

32 © Emmanuel FUCHS.

A driver doesn't care of engine's internal working.He only knows the interface

Object analogy

Implementation Interface

Page 33: Object Oriented Software techniques

33 © Emmanuel FUCHS.

A driver doesn't care of engine's internal working.He only knows the interface

Object analogy

Implementation Interface

Page 34: Object Oriented Software techniques

34 © Emmanuel FUCHS.

A driver doesn't care of engine's internal working.He only knows the interface

Object analogy

Implementation Interface

Page 35: Object Oriented Software techniques

35 © Emmanuel FUCHS.

Interfacevehicle {

attributes engine

interface car {

start()accelerate()stop()

}}

car start()

Page 36: Object Oriented Software techniques

36 © Emmanuel FUCHS.

Inheritance

Page 37: Object Oriented Software techniques

37 © Emmanuel FUCHS.

Polymorphism

Accelerate

Page 38: Object Oriented Software techniques

38 © Emmanuel FUCHS.

Interface VS implementation inheritance

Implementation

(body)

Interface

(specification)

Page 39: Object Oriented Software techniques

39 © Emmanuel FUCHS.

Interface VS implementation inheritance

Accelerate

Accelerate

Page 40: Object Oriented Software techniques

40 © Emmanuel FUCHS.

Inheritance and polymorphism

Point

+print()

1DPoint

+ print()

ClientPrint()

2DPoint

+ print()

3DPoint

+ print()

NDPoint

+ print()

Teleportation

Page 41: Object Oriented Software techniques

41 © Emmanuel FUCHS.

Inheritance and polymorphism

<<Interface>>Point

+print()

1DPoint

+ print()

ClientPrint()

2DPoint

+ print()

3DPoint

+ print()

NDPoint

+ print()

Teleportation

Page 42: Object Oriented Software techniques

42 © Emmanuel FUCHS.© Emmanuel FUCHS. THALES ATM

Distributed Object Programming

� Raising abstraction

� Object Programming

� Programming for changes

� Programming in future tense

� Programming for reuse

� Programming by interface

� Letting old code calling new code

� Polymorphism and dynamic binding

Page 43: Object Oriented Software techniques

43 © Emmanuel FUCHS.

Change management before OO

Current Code Current Code

Page 44: Object Oriented Software techniques

44 © Emmanuel FUCHS.

Change management before OO

New Code Old Code

Page 45: Object Oriented Software techniques

45 © Emmanuel FUCHS.

Change management before OO

New Code Old Code

Old Code New Code

Page 46: Object Oriented Software techniques

46 © Emmanuel FUCHS.

Change management and code reuse before OO

New Code Old Code

Old Code New Code

Modify Old Code

Page 47: Object Oriented Software techniques

47 © Emmanuel FUCHS.

Change management with OO reuse

Current Code Current Code

Old Code New Code

Add new Code without Modifying Old Code

Page 48: Object Oriented Software techniques

48 © Emmanuel FUCHS.

Change management with OO reuse

Current Code Current Code

Old Code New Code

Add new Code without Modifying Old Code

Framework