oo requirements to oo design csaba veres alan m. davis (1995), colorado

41
OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Upload: junior-thomas

Post on 18-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

Do we practice what we preach? ● 31% of systems built today are never delivered ● another 15% had less than half of the customers needs satisfied ● but are requirements engineers really to blame? ● criticizes standard academic practice – suggests some alternative problem scenarios

TRANSCRIPT

Page 1: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

OO Requirements to OO design

Csaba VeresAlan M. Davis (1995), Colorado

Page 2: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Alan Davis

● “Guru”● Academic and professional

– www.omni-vista.com● Controversial article on research into

requirements engineeringRequirements Researchers: Do We Practice What We Preach?Requirements Eng (2002) 7:107–111

Page 3: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Do we practice what we preach?

● 31% of systems built today are never delivered● another 15% had less than half of the customers

needs satisfied● but are requirements engineers really to blame?● criticizes standard academic practice

– suggests some alternative problem scenarios

Page 4: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 5: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Introduction to OO

● Object orientation proposed in 1960s as a programming technique– an object is a data abstraction

● encapsulation of protected data, procedures, processes to manipulate the data

– classes● generic set of objects or other classes

– inheritance

Page 6: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

intro ...

● OOP (OO Programming) languages developed by late 1980s

● OOD (Design) techniques developed by the mid 1980s.

● Close connection between OOD and specific OOP languages– Booch: ADA, Meyer: Eiffel

● OOR (Requirements) also developed in the late 1980s.

● OOA (Analysis) is a sub set of OOR

Page 7: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

OOR● Software requirements aims to understand and

document the needs of the user– problem analysis

● understanding– requirements specification

● documenting (SRS: Software Requirements Specification)● “Expected external behavior”

– description of all inputs, outputs, possible mapping relationships between them

● OOR is good at describing the problem domain– used to model objects from the SRS– external behavior ?

Page 8: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

OOD● purpose of design is to transform requirements into an optimal

configuration (architecture) for implementation● OO optimizes

– maintainability– reusability– enhanceability– reliability

● encapsulation ensures– less errors– easier to find errors– less risk of errors after changes

Page 9: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

OOR vs. OOD

● OOD optimizes reusability, etc.● OOR optimizes understandability● So, is an object the same in OOD and OOR?● OOR captures

– real world entities– attributes and states of that entity– the services provided by that entity– inherited attributes and services

Page 10: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

OOR vs. OOD ...

● OOD captures– an encapsulation of attributes and states of an entity– an encapsulation of services and operations– inheritance of attributes and operations

● Real world (OOR) vs. software design (OOD)– understandability and accuracy vs. optimal design for

performance and maintainability

Page 11: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Four origins of OOR (as it stood in 1995)

● OOD– main difference is level of detail

● Database design– adaptation of ER– problem with function definitions

● Requirements analysis– already had some methods for looking at “domain

entities”● Structured analysis

– change to and call it OO

Page 12: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Transition from OOR to OOD● Many different opinions by leaders in the field● Jacobson and Embley

– analysis and design objects are identical– “object oriented construction means that the analysis

model is designed and implemented in source code ..”● Coad, Yourdon, Booch, Rumbaugh

– design follows “simply” from requirements– “moving from analysis to design is a progressive

expansion of the model”– add detail to existing objects, as well as new objects

Page 13: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Transition from OOR to OOD

● Cherry, Lorenz, Wirfs-Brock .... & Davis– it is good to seperate requirements from design

● allows us to worry about external behaviour without efficiency, reuse, etc.

– OOR provides a draft document that can be changed at design time

Page 14: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

OOR vs. OOD

● OOD is the selection of the optimal solution to a required set of external behaviors– not easy

● differneces introduced in the transition1 Different objects.

i. OOR: is the object important for understanding the problem?ii. OOD: is the inclusion of the object important for software

quality?iii. e.g. elevator requirements: passenger, design: floor requests

Page 15: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

2 Aggregationi. OOR records aggregation to understand the objects.

– e.g., elevator control panel shall include floor select button, emergency button, open/close button ...

ii. OOD has aggregation to optimize software packaging– e.g. ControlPanel will always include button, subtype ....

3 Instantiationi. OOR does not worry about instance creation/destruction, or

states (to some extent)– e.g. passengers just appear

ii. OOD has to worry about instantiation and attribute modification

4 Different emphasis on servicesi. OOR does not require a complete specification of the

services, algorithms of all objectsii. OOD clearly does

Page 16: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

5 Genericity of services and Dynamic Bindingi. OOR wants to avoid ambiguity, so services should be

uniquely labeledii. OOD makes use of polymorphism and dynamic binding to

achieve runtime behavior

6 Verification and Validationi. Verifying OOR for clarity and accuracyii. Verifying OOD for correctly satisfying the requirement

Page 17: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Transitioning advice

● So it is not THAT easy to transition from OOR to OOD– e.g. many changes have to be made

● Techniques for easing the transition:1 Recognize that SRS is necessary

i. OOR is not very good at describing external system behavior (e.g. push button A green light comes on)

ii. supplement each OOR object with its contribution to external system behavior

Page 18: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

2 Don't underestimate the difficulty3 Use a system development process appropriate for the

applicationi. e.g., for complex systems, do system requirements, partition

into subsystems, subsystem software requirements, etc.

4 Use OOR objects as a starting pointi. difficulty is in deciding which ones will make good design

5 Add other objects from SRSi. external interfaces might have been missed in OOR, and can

add objects to the design

6 Use accepted design principles to complete the designi. reusable objects, libraries, etc.

Page 19: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Ontology and other things

Csaba Veres

Page 20: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Conceptual Modeling

The “real world”A Model

Some people

Page 21: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Reality?

● Milton (2002)– “Data modelling languages are used to create models

of real world information systems..”– “... assess its capacity to “capture our reality” ...”– “... capturing reality is subjective ...”– “... models should be consistent enough with our

perceptions of reality ...”

Page 22: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Why reality?

● Wand, Storey & Weber (1999)– “... users of conceptual modeling methodologies are

frequently confused about whether to show an association as a relationship, entity, or attribute”

● The correct application of the constructs is not clear

● Milton (2002)– “... ontology can be viewed as an intellectual “lense”

through which to view reality ...”

Page 23: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Example: construct overloadis “Assignment” an entity?

City Worker

Project

Assignment

Page 24: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

The “real world” and “the model”

Thing Thing

The world

Entity Entity Entity

The model

Page 25: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Perception and “Reality”● So, our “... perception of reality” can not be

trusted● Ontology tells us what the real world is really like● Many different ontologies exist● Bunge

– things● intrinsic property, mutual property● attribute

– dynamics of things: state change– interaction of things– composition: emergent properties– classification: specialisation

Page 26: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado

Prescriptive ontology

● An ontology can tell us how we SHOULD model certain things

● e.g. never model mutual properties as entities● ENROLLMENT

Student Universityenrolled

Student UniversityEnrollment

Page 27: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 28: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 29: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 30: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 31: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 32: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 33: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 34: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 35: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 36: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 37: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 38: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 39: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 40: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado
Page 41: OO Requirements to OO design Csaba Veres Alan M. Davis (1995), Colorado