6 12 From%20Logical%20Design%20to%20Physical%20Design

19
6.6 From Logi cal Desi gn to Phys ical Desi gn up to now: considered logical design software architecture, interface description, software quality issues starting point of design: OOA model steps: 1. architectural design 2. implementation design Vorl¨ auge Version 442 5. Juli 2004, Peter Thiemann

Transcript of 6 12 From%20Logical%20Design%20to%20Physical%20Design

Page 1: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 1/19

6.6 From Logical Design to Physical Design

up to now: considered logical design

• software architecture,

• interface description,

• software quality issues

starting point of design: OOA model

steps: 1. architectural design

2. implementation design

Vorlaufige Version 442 5. Juli 2004, Peter Thiemann

Page 2: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 2/19

Architectural Design

• user interface, persistent data management, system interfaces

• deployment

• adaption, extension, and refinement of OOA model→ OOD model (e.g. in UML): navigation, container classes, etc

• reuse: class libraries, components (Halbfabrikate )

Implementation Design

• tailoring to programming language

• transformations: multiple → single inheritance; elimination of inheritance

Vorlaufige Version 443 5. Juli 2004, Peter Thiemann

Page 3: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 3/19

6.6.1 Class Libraries

• commercial or part of IDE

• GUI, graphics, data structures and algorithms, data base access,

communication

• organization principles

tree relies on inheritance (one root class); complicated to use

forest loosely coupled classes with shallow inheritance relations

flat independent classes; parameterized; easy to use

• multiple implementations of interface with different features

• class adapters (another design pattern)

• framework: adaptable system of cooperating classes

Vorlaufige Version 444 5. Juli 2004, Peter Thiemann

Page 4: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 4/19

6.6.2 Components

Component: building block of a software architecture

Features:

• Service– interface specification

– protocol

• composition

• adaption

• open

Goals:

• binary reuse

• unification of form, function, . . .

• standards

Vorlaufige Version 445 5. Juli 2004, Peter Thiemann

Page 5: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 5/19

Prefabricated Components

Intention: acceleration of software design and implementation by guing

prefabricated parts

⇒ software factory

GUI Components: • (Swing)

• JavaBeans

• ActiveX

Server Components: COM+, EJB, CORBA (middleware, business

logic)

• independence of language, platform, and location

• distribution and interoperability

Vorlaufige Version 446 5. Juli 2004, Peter Thiemann

Page 6: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 6/19

Components vs Objects

• Component = object

– Component → one or more objects (COM)

– one method implementation per interface– language independent specification

• Component = distributed object

alternatives: in process (DLL), local (IPC), remote (RMI, SOAP,

CORBA)

• Component = class

– physical structure vs. logical structure

– inheritance

• interface management (IDL)

• dynamic binding

Vorlaufige Version 447 5. Juli 2004, Peter Thiemann

Page 7: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 7/19

6.6.3 Architectural Design

Extending the OOA model by

• directions of associations

• comments

• visibility of attributes and operations

• class attributes and operations• wrappers for legacy / DB systems

Vorlaufige Version 448 5. Juli 2004, Peter Thiemann

Page 8: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 8/19

Class attributes and operations

• have to be removed with OODB

• → introduce auxiliary class

• → singleton pattern

OOD

*

1AccountC

average

Account

average

OOA

Account

Vorlaufige Version 449 5. Juli 2004, Peter Thiemann

Page 9: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 9/19

User-defined attribute types

Elementary classes include in OOD model only if multiple uses

OOD

OOA

11street

town

PersonAddressT

Personaddress : AddressT

Companyaddress : AddressT

Company

state

Vorlaufige Version 450 5. Juli 2004, Peter Thiemann

Page 10: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 10/19

Enumeration types

OOA OOD

1Polygon

color

Polygon

redgreen

blue

«enumeration»Color

Vorlaufige Version 451 5. Juli 2004, Peter Thiemann

Page 11: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 11/19

6.6.4 Embedding a relational DB

OO-layer transforms

1. classes → relations

2. associations → secondary keys

3. inheritance → system of relations

4. compound types → base types5. optimistic → pessimistic transactions

6. OO-access methods → SQL

Vorlaufige Version 452 5. Juli 2004, Peter Thiemann

Page 12: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 12/19

Classes → relations

Person OID

no

first name

no name

Person

first name

name

• map attribute type to SQL type

• add column for object identity

(OID, reference/pointer)

• identify mandatory attributes

• index

create table Person

( OID number(8) not null,

no number(8) not null,

first_name char(20),name char(20) not null,

primary key (no)

);

create secondary index PersonIndexon Person(name);

Vorlaufige Version 453 5. Juli 2004, Peter Thiemann

Page 13: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 13/19

Associations → secondary keys

• 1 : m -association:

K1

K2

*1

K1

A1

A2

K2

A3

OID1

OID2 A3 A4 OID1

A2A1

A4

• n  : m -association (n ,m  > 1):

K1-2

OID1K2

A3

A4

*

A1 A2OID1

K1

*A1

A2

K1

A4A3OID2

K2

OID2

Vorlaufige Version 454 5. Juli 2004, Peter Thiemann

Page 14: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 14/19

Inheritance → systems of relations

1. one relation per class

• each relation contains primary key

• additional attribute determines subclass

• small schema but information dispersed (efficiency?)

Employee

42 4619Customer Employee

Sales Wage

OID

OID Sales

Person

Customer

27

42

Name Name Group

May

Nolan

Cust.

Emp.

27 3212

Person

OID Wage

Vorlaufige Version 455 5. Juli 2004, Peter Thiemann

Page 15: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 15/19

Page 16: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 16/19

6.6.5 Implementation Design

Elimination of multiple inheritance 1. Aggregation of roles

move()

move()max. altitude

Airplane

move()draught

Ship

Vehicle

location

speed

Role

1

1..2

Vehicle

move()

location

speed

move()

draughtShip

Seaplane

move()

move()

max. altitudeAirplane

Vorlaufige Version 457 5. Juli 2004, Peter Thiemann

Page 17: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 17/19

2. Flattening heterarchy → hierarchy

max. altitude

Seaplane

move()

draughtmove()

max. altitude

Airplane

Vehicle

move()

location

speed

move()

draught

Ship

Vorlaufige Version 458 5. Juli 2004, Peter Thiemann

Page 18: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 18/19

Elimination of inheritance

• languages w/o inheritance: Ada, C

• transfer all attributes and operations from superclasses into each

“class”SeaplaneAirplane Ship

move()

move()

move()draught

max. altitudemax. altitude

speed

location location location

speed speed

draught

Vorlaufige Version 459 5. Juli 2004, Peter Thiemann

Page 19: 6 12 From%20Logical%20Design%20to%20Physical%20Design

8/14/2019 6 12 From%20Logical%20Design%20to%20Physical%20Design

http://slidepdf.com/reader/full/6-12-from20logical20design20to20physical20design 19/19

Further tailoring to PL

• identifier conventions

• base types

• administrative operations (constructors, destructors, initialization,

management of associations and aggregations, access and update of 

attributes)

• container classes

• visibility

• transfer object lifecycles (FSM) to algorithms

viz. the state pattern

Vorlaufige Version 460 5. Juli 2004, Peter Thiemann