77
2004 by SEC Chapter 3 Requirements Engineering

2004 by SEC Chapter 3 Requirements Engineering

Embed Size (px)

Citation preview

Page 1: 2004 by SEC Chapter 3 Requirements Engineering

2004 by SEC

Chapter 3 Requirements Engineering

Page 2: 2004 by SEC Chapter 3 Requirements Engineering

2

2004 by SEC

Chapter 3 Requirements Engineering

3.1 Requirements engineering3.1.1 Software requirements

3.1.2 Characteristics of requirements

3.1.3 Requirements engineering

3.1.4 Requirements elicitation

3.2 Requirements analysis 3.2.1 Software modeling

3.2.2 Use Case Diagrams

3.2.3 Entity-Relationship diagram (ERD)

3.2.4 Data Flow diagrams (DFD)

3.2.5 State diagrams

Page 3: 2004 by SEC Chapter 3 Requirements Engineering

3

2004 by SEC

Chapter 3 Requirements Engineering (cont’d)

3.3 Object-oriented (OO) software engineering

3.3.1 Object Orientation

3.3.2 Object Orientation Development

3.3.3 Steps of Analysis: an Example Using OO Approach

3.3.4 A Modeling Example

3.4 Data modeling and OOA

3.4.1 Data modeling vs. OOA

Page 4: 2004 by SEC Chapter 3 Requirements Engineering

4

2004 by SEC

3.1 Requirements Engineering

Page 5: 2004 by SEC Chapter 3 Requirements Engineering

5

2004 by SEC

Requirement– Functional requirement describes system services or functions

– Non-functional requirement is a constraint or a goal on the system or on the development process

User (Customer) requirement– A statement in natural language plus diagrams of the services the system

provides and its operational constraints

Requirements specification– A structured document for detail description of the system services.

– Written as a contract between client and developer

Software Requirements

Page 6: 2004 by SEC Chapter 3 Requirements Engineering

6

2004 by SEC

Incomplete Requirements– Most software systems are complex, that developer can never fully

captured during the system development, therefore, requirements are always incomplete.

Inconsistent Requirements– Different users have different requirements and priorities. There is a

constantly shifting compromise in the requirements.

– Prototyping is often required to clarify requirements.

Characteristics of Requirements

Page 7: 2004 by SEC Chapter 3 Requirements Engineering

7

2004 by SEC

the problemthe problemrequirementsrequirements

elicitationelicitation

build abuild aprototypeprototype

createcreateanalysisanalysismodelsmodels

developSpecification ReviewReview

Requirement Engineering

Process

Page 8: 2004 by SEC Chapter 3 Requirements Engineering

8

2004 by SEC

Requirements elicitation– Determine what the customer requires

Requirements analysis– Understand the relationships among various customer requirements

Requirements negotiation– Shape the relationships among various customer requirements to

achieve a successful result

– Research on requirements trade-off analysis (formulating as goals)

Requirements specification– Build a form of requirements

Requirements Engineering (cont’d)

Page 9: 2004 by SEC Chapter 3 Requirements Engineering

9

2004 by SEC

Modeling– Build a representation of requirements that can be assessed for

correctness, completeness and consistency.

Requirements validation – Review the model and specification

Requirements management– Identify, control and track requirements and the changes.

Requirements Engineering (cont’d)

Page 10: 2004 by SEC Chapter 3 Requirements Engineering

10

2004 by SEC

Requirements Elicitation

Two sources of information for the requirements elicitation– Users and organizations

– Application domains

Page 11: 2004 by SEC Chapter 3 Requirements Engineering

11

2004 by SEC

Elicitation Techniques Asking

– Ask users what they expect from the system

– Interview, brainstorm, group meeting, questionnaire, and JAD (Joint Application Development)

Form analysis– A lot of information about the domain can be found in various forms and

manuals

– Forms provide us with information about the data objects of the domain, their properties, and their interrelations

Derivation from an existing system– Take the peculiar circumstances of the present situation into account

Page 12: 2004 by SEC Chapter 3 Requirements Engineering

12

2004 by SEC

Elicitation Techniques (cont’d)

Observation

Prototyping

Task analysis– High-level tasks can be decomposed into sub-tasks

Scenario-based analysis– Study instances of tasks

– A scenario can be real or artificial

Description– Natural language

– with background information to be used in conjunction with other elicitation techniques such as interviews

Page 13: 2004 by SEC Chapter 3 Requirements Engineering

13

2004 by SEC

Example of Requirements Elicitation

Use QFD to prioritize

requirements

informally prioritize

requirements

formal prioritization?

Create Use-cases

yes noElic it requirements

write scenario

define actors

complete template

draw use-case diagram

Conduct FASTmeetings

Make lists offunctions, classes

Make lists ofconstraints, etc.

Page 14: 2004 by SEC Chapter 3 Requirements Engineering

14

2004 by SEC

3.2 Requirements Analysis

Page 15: 2004 by SEC Chapter 3 Requirements Engineering

15

2004 by SEC

Build the analysis model– Data Modeling

– Functional Modeling

– Behavioral Modeling

– Scenario-based Modeling

– Class-based Modeling

Requirement Analysis

Page 16: 2004 by SEC Chapter 3 Requirements Engineering

16

2004 by SEC

Purpose– Build a representation of requirements that can be assessed for

correctness, completeness and consistency.

– Abstract away those that are irrelevant.

Model: an abstraction for– Understanding before (actually) building

– Communication

– Visualization

– Reducing complexity

Methodology: build (analyze) a model of an application domain

Software Modeling

Page 17: 2004 by SEC Chapter 3 Requirements Engineering

17

2004 by SEC

Application and Solution Domain

Application Domain (Requirements Analysis)– The environment in which the system is operating

Solution Domain (System Design, Object Design)– The available technologies to build the system

Page 18: 2004 by SEC Chapter 3 Requirements Engineering

18

2004 by SEC

Information domain analysis– information flow: the flow of data through data transformations

– data content and relationship; data structure

– data modeling (data dictionary, ERD)

Functional and behavioral representation– function: process/transformation; functional modeling (DFD)

– behavior: behavioral modeling (state transition diagram)

Scenario-based Modeling– Use case Modeling: build use case diagrams

Class-based Modeling– OOA: class diagrams

The Analysis Model

Page 19: 2004 by SEC Chapter 3 Requirements Engineering

19

2004 by SEC

Interface definition– function/process interface

Problem partition and abstraction– at different levels of abstraction

– classification and assembly structure

The Analysis Model (cont’d)

Page 20: 2004 by SEC Chapter 3 Requirements Engineering

20

2004 by SEC

Use Case Modeling

Used to represent software requirements.

A collection of user scenarios that describe the thread of usage of a system.

Each scenario is described from the point-of-view of an “actor”.– actor: a person, device, or system that interacts with the software in

some way

Page 21: 2004 by SEC Chapter 3 Requirements Engineering

21

2004 by SEC

Use Case Diagrams

homeowner

Arms/ disarms system

Accesses system via Internet

Reconfigures sensors and related

system features

Responds toalarm event

Encounters anerror condition

system administrator

sensors

actor actor

use case

Page 22: 2004 by SEC Chapter 3 Requirements Engineering

22

2004 by SEC

Traditional Software Engineering

Software Systems

Data ModelFunctional Model Behavioral model

Entity-RelationDiagrams

Data FlowDiagrams

State TransitionDiagrams

Page 23: 2004 by SEC Chapter 3 Requirements Engineering

23

2004 by SEC

Entity– Primary things an organization collects and records information

about. (noun) ( )

E.g. persons, products, places, etc.

Relationship– Linkage between entities. (verb) ( or )

E.g. Persons perform jobs, Jobs consist-of tasks

Cardinality– Identify how many instances of one entity are related to how many

instances of another entity.

Entity-Relationship Diagram

Page 24: 2004 by SEC Chapter 3 Requirements Engineering

24

2004 by SEC

Examples

Persons

Jobs

Perform

Customers

Tasks

Serve

Consist-of

1:1 Persons

Jobs

1:N

consist_of

Jobs

Tasks

M:Nserve

Persons

Customers

Entity-Relationship Diagram (cont’d)

perform

Directionusing an arrow pointing to the object of the action

Page 25: 2004 by SEC Chapter 3 Requirements Engineering

25

2004 by SEC

Attributes: Properties to describe an entity– key attribute (key, identifier) to characterize the specific entity (to

retrieve a single entity occurrence (instance))

unique: to ensure that no other record has the same identifier.

unchanging: to ensure that it always refers to the same thing.

Students Faculty

Courses

AssistAdvice

TeachTake

Entity-Relationship Diagram (cont’d)

Page 26: 2004 by SEC Chapter 3 Requirements Engineering

26

2004 by SEC

– Student is an entity about which an university stores info such as the Student_id, name, and phone.

Compound keys: made up of a number of different subkeys to produce a unique identifier– e.g. course number + section number + term

50416938 Doakes, Jane 242-714771426006 Blough, JO 426-4141

Entity type Key attribute Attribute

real data

Student_id name phone

e.g.

Entity-Relationship Diagram (cont’d)

student

Page 27: 2004 by SEC Chapter 3 Requirements Engineering

27

2004 by SEC

– Recursive relationships: an entity is related to itself

e.g.

Person

Is_Married_To

Is_Parent_of

Is_Child_of

Entity-Relationship Diagram (cont’d)

Page 28: 2004 by SEC Chapter 3 Requirements Engineering

28

2004 by SEC

– N-ary relationships

e.g.

Entity-Relationship Diagram (cont’d)

Page 29: 2004 by SEC Chapter 3 Requirements Engineering

29

2004 by SEC

Entity-Relationship Diagram (cont’d)

Location

Employee

Fname Lname

Name

Ssn

Bdate

Supervision

1 N

Works_for

Manages

Works_on

Dependent

Dependents_of

Sex

Address

Salary

Hours

Project

Department

Dname Dno

Controls

Pno Pname

Name Sex Bdate Relationship

StartDate

1

N

N

M

N

N

1

1

1 1

Lcations

Page 30: 2004 by SEC Chapter 3 Requirements Engineering

30

2004 by SEC

Data Flow Diagrams (DFD)

Basic Notation:– : process (transformer of information)

– : external entity (procedure/consumer of information)

– : data item

– : data store (repository of data observed by processes)

Page 31: 2004 by SEC Chapter 3 Requirements Engineering

31

2004 by SEC

Data Flow Diagrams (cont’d)

DFD can be used to represent a system at any level of abstraction by refinement. – level 0: context model (a single bubble)

– information flow continuity: I/O to each refinement must remain the same. (balancing)

No explicit indication of the sequence of processing is supplied by the DFD.– Control flow is not explicit. The truth is that control is excluded in DFD

intentionally.

– Explicit procedural representation is delayed until design.

Page 32: 2004 by SEC Chapter 3 Requirements Engineering

32

2004 by SEC

Data Flow Diagrams (cont’d) processing narrative

– To specify the processing details in the bubble.

inputs to the bubble

algorithm applied to the input

Output

Restrictions & limitations imposed on the process.

Performance characteristics related to the process.

Design constraints

– usually by natural language

Page 33: 2004 by SEC Chapter 3 Requirements Engineering

33

2004 by SEC

Data Flow Diagrams (cont’d)

Data represented by– data item

– data store

Content of data– a collection of data items:

data dictionary (DD); only content no relationship

– a need to represent relationship between complex collections of data:

E-R diagram (ERD) for data modeling; content and relationship

Page 34: 2004 by SEC Chapter 3 Requirements Engineering

34

2004 by SEC

Data Dictionary precise, rigorous definitions of all data elements pertinent to

the system.

usually contain the following information:– Name, Alias, Where used/How used, Content description,

supplementary information.

– Content description notation

= / + / [ | ] / { }n / ( …) / *…*

composed of / and / selection / n repetitions of / option / comments

Page 35: 2004 by SEC Chapter 3 Requirements Engineering

35

2004 by SEC

Data Dictionary (cont’d) Example of content description:

telephone number = [local number | long distance number]

local number = prefix + access number

long distance number = 1 + area code + local number

area code = [365 | 658 | 887]

prefix = *a three digit number that never starts with 0 or 1*

access = *any four number string*

Page 36: 2004 by SEC Chapter 3 Requirements Engineering

36

2004 by SEC

DFD Example

useruserprocessing processing

requestrequest

videovideosourcesource NTSCNTSC

video signalvideo signal

digitaldigitalvideovideo

processorprocessor

requestedrequestedvideovideosignalsignal

monitormonitor

Level 0

Page 37: 2004 by SEC Chapter 3 Requirements Engineering

37

2004 by SEC

PPaa bbxx yy

p1p1p2p2

p3p3p4p4 p5p5

aa

bb

cc

ddee

ff

gg

DFD Example (Cont’d)

Level 0Level 0

Level 1Level 1

iihh

DBDB

Page 38: 2004 by SEC Chapter 3 Requirements Engineering

38

2004 by SEC

Balancing ERD against DFD Every data store on the DFD must correspond to an entity

type, or a relationship, or a combination of an entity type and relationship.– If there is a store on the DFD that does not appear on the ERD,

something is wrong.

– If there is an entity or relationship on the ERD that does not appear on the DFD, something is wrong.

Page 39: 2004 by SEC Chapter 3 Requirements Engineering

39

2004 by SEC

State Transition Diagrams

Outsideworld

Application

events behavior

Page 40: 2004 by SEC Chapter 3 Requirements Engineering

40

2004 by SEC

State Transition Diagrams (cont’d) state—a set of observable circumstances that characterizes the

behavior of a system at a given time

state transition—the movement from one state to another

event—an occurrence that causes the system to exhibit some predictable form of behavior

action—process that occurs as a consequence of making a transition

activity—process that occurs in a state

Page 41: 2004 by SEC Chapter 3 Requirements Engineering

41

2004 by SEC

State Transition Diagrams (cont’d)

statestate

new statenew state

event causing transition (condition)event causing transition (condition)

action that occursaction that occursstate transition:

Page 42: 2004 by SEC Chapter 3 Requirements Engineering

42

2004 by SEC

State Transition Diagrams (cont’d)

readingreadingoperatoroperator

commandscommands

making copiesmaking copies reloading paperreloading paper

problem stateproblem state

Not emptyNot emptyinvoke read-op-inputinvoke read-op-input

Not empty and startNot empty and startinvoke manage-copyinginvoke manage-copying

copies donecopies doneinvoke read-op-inputinvoke read-op-input

emptyemptyinvoke reload paperinvoke reload paper

jammedjammedinvoke problem-diagnosisinvoke problem-diagnosis

not jammednot jammedinvoke read-op-inputinvoke read-op-input

Page 43: 2004 by SEC Chapter 3 Requirements Engineering

43

2004 by SEC

3.3 Object-oriented (OO) Software Engineering

Page 44: 2004 by SEC Chapter 3 Requirements Engineering

44

2004 by SEC

Object-Oriented Software Engineering

Scenario-based Model

Software Systems

Functional ModelObject Model Behavioral Model

Data FlowDiagrams

ClassDiagrams

State Charts

Use CaseDiagrams

Page 45: 2004 by SEC Chapter 3 Requirements Engineering

45

2004 by SEC

Why Objects? Real-world objects vs. Software objects

– communications

Applicationdomain

Solutiondomain

Object necessaryfor describing asolution - problemspace

Object requiredfor implementation a solution - solutionspace

software realizationof the real-worldproblem

Page 46: 2004 by SEC Chapter 3 Requirements Engineering

46

2004 by SEC

Application and Solution Domain

UML Package

Application Domain Solution Domain

Application Domain Model System Model

Aircraft TrafficController

FlightPlan Airport

MapDisplay

FlightPlanDatabase

SummaryDisplay

TrafficControl

TrafficControl

Page 47: 2004 by SEC Chapter 3 Requirements Engineering

47

2004 by SEC

Object Orientation Identity:

– each object is a discrete and distinguishable entity.

– each real-world object is unique due to its existence.

– each object has its own inherent identity, therefore, two objects are distinct even if all their attribute values are identical.

Classification:– objects with the same attributes and operations are grouped into a

class

– each object is said to be an instance of its

class

– e.g. Bicycle object -------> Bicycle class

Attributes:frame sizewheel size

Operations:shiftmove

Page 48: 2004 by SEC Chapter 3 Requirements Engineering

48

2004 by SEC

Class Class:

– An abstraction in the context

– encapsulates both state (attributes) and behavior (methods)

– Can be defined in terms of other classes using inheritance

Criteria of selecting classes– Retained information

– Needed services

– Multiple attributes

– Common attributes

– Essential requirements

Page 49: 2004 by SEC Chapter 3 Requirements Engineering

49

2004 by SEC

Inheritance Inheritance:

– the sharing of attributes and operations among classes based on a hierarchical relationship

– each subclass inherits all of the properties of its superclass and adds its own unique properties (called extension)

– reusability

© 1993 - 2003, Jonathan Lee, All Right Reserved.

Page 50: 2004 by SEC Chapter 3 Requirements Engineering

50

2004 by SEC

Polymorphism Polymorphism:

– the same operation behaves differently on different classes

– an operation is an action or transformation that an object performs or is subject to

– method: a specific implementation of an operation

a polymorphic operation is an operation that has more than one method implementing it.

Page 51: 2004 by SEC Chapter 3 Requirements Engineering

51

2004 by SEC

Polymorphism (cont’d)

Static polymorphism– Overloading: an invocation can be operated on arguments

of more than one type.

Class TimeOfDay {

public void setTime(char[8] time) {…};

public void setTme(int h, int m, int s) {…};

}

TimeOfDay aClock= new TimeOfDay( );

aClock.setTime(17,1,0);

aClock.setTime(“11:55:00”);

Page 52: 2004 by SEC Chapter 3 Requirements Engineering

52

2004 by SEC

Polymorphism (cont’d)

Dynamic polymorphism:– object reference can refer to an instance of any of descendants of its class

– an instance of the subclass created, and is also an instance of each that subclass’s ancestor

– the same operation may behave differently on different classes

method: a specific implementation of an operation

a polymorphic operation is an operation that have more than one method implementing it.

Page 53: 2004 by SEC Chapter 3 Requirements Engineering

53

2004 by SEC

Polymorphism (cont’d)

class Student extends Person {

void getName() { System.out.println(“Student”); }

class Employee extends Person {

void getName() { System.out.println(“Employee”); }

}

public static void main(String [ ] args) {

Person p;

BufferedReader in=new BufferedReader(

new InputStreamReader(System.in));

int num=Integer.parseInt(in.readLine());

if (num= =1) p = new Employee( );

else p = new Student( );

p.getName( );

}

Page 54: 2004 by SEC Chapter 3 Requirements Engineering

54

2004 by SEC

Object-Oriented Development

Life-cycle– development:analysis,design,and implementation

– testing:

– maintenance:

modeling vs. implementationOOA/D: front-end conceptual issues

reduce cost.

OOP: back-end implementation issues.

restrict design choices.

Page 55: 2004 by SEC Chapter 3 Requirements Engineering

55

2004 by SEC

Software Artifacts Problem statements:

– to describe the problem to be solved and providing a conceptual overview of the proposed system

Analysis:– to understand and model the application and the domain (usually called a

modeling activity)

– the output is a model capturing: functionality, behavior, and structure

Design:– Data Design:data abstraction;data structure;data modeling

– Procedural Design: iteration , conditional, sequence

– Architectural Design: program structure ( control hierarchy ); system organization ( software architecture )

Implementation:– Executable code

Page 56: 2004 by SEC Chapter 3 Requirements Engineering

56

2004 by SEC

OMT Methodology Stages:

– Analysis:

Problem statement. (usually incomplete, incorrect)

– Design:

System design

Decision making

stage

object design

Analysis

-abstraction of what the desired system must do.-application-domain concepts NOT implementation concepts

Analysis model

System Design-organize the target system into subsystems-decide performance characteristics

object design-data structural & algorithm to implement each class.

depends onthe performancemeasure

problemstatements

Page 57: 2004 by SEC Chapter 3 Requirements Engineering

57

2004 by SEC

OMT Methodology (cont’d)

Three models:– object model: the static structures of objects &

their relationships

object diagrams: object classes (node), relationships

(arc).

– dynamic model: interactions(control) among objects

state diagrams: states(node), transitions(arc) by events

– functional model: data transformation of objects

data flow diagrams: processes(node), dataflows(arc).

change over time

Page 58: 2004 by SEC Chapter 3 Requirements Engineering

58

2004 by SEC

Basic Concepts Abstraction: focus on the essential, inherent aspects of entity

and ignoring its accidental properties.– e.g. Use of abstraction during analysis: deciding only with

application-domain concepts, not making design and implementation decisions.

Encapsulation: (OO) separate the external aspects of an object, which are accessible to other objects, from the internal implementation details of the object, which are hidden from other objects.

Sharing through inheritance (Reuse)– data structures and behaviors (design)

– code

Page 59: 2004 by SEC Chapter 3 Requirements Engineering

59

2004 by SEC

Features of Object Orientation: Blair’s Version

Identify– The unique identification of every object is through the use of an

object identifier.

Encapsulation– The selection of properties to be encapsulated.

attributes, operations, representations, algorithms...

– The determination of visibility of these properties. (I.e. a well-defined interface)

Classification: group associated objects according to common properties– The Intent of a classification is the description of that classification

characteristics, therefore, the intent specifies a predicate.

Page 60: 2004 by SEC Chapter 3 Requirements Engineering

60

2004 by SEC

Features of Object Orientation: Blair’s Version (cont’d)

– The extend of a classification is the set of objects in the current environment which features such behavior, that is, a population selected by applying a predicate.

Flexible sharing: The ability for an object to belong to more than one classification. and will require a flexible form of behavior sharing.– are based on the encapsulated properties, the considered classification

scheme, the relationship between classifications.

Interpretation: The resolution of the precise semantics of the shared item of behavior.– two steps involved in the resolution: type checking and binding.

typing checking: determination of whether operations are supported by a particular object

binding: locate the correct implementation of the operation.

Page 61: 2004 by SEC Chapter 3 Requirements Engineering

61

2004 by SEC

Build the use case model: use case diagrams

Build the object model: class diagrams– Extract candidate classes

– Identify attributes for each class

– Establish basic class relationships

– Define a class hierarchy

– Specify methods that service the attributes

– Indicate how classes/objects are related

Build the behavioral model: state charts

Build the functional model: data flow diagrams

Steps of Analysis: An Example Using OO Approach

Page 62: 2004 by SEC Chapter 3 Requirements Engineering

62

2004 by SEC

Classes Associations (Relations)

– Part of- Hierarchy (Aggregation)

– Kind of-Hierarchy (Generalization)

Attributes– Application specific

– Attributes in one subsystem can be classes in another subsystem, turning attributes to classes

Service– Domain Methods: Dynamic model, Functional model

– Operation: A function or transformation applied to objects in a class. All objects in a class share the same operations (Analysis Phase)

– Signature: Number & types of arguments, type of result value. All methods of a class have the same signature (Object Design Phase)

– Method: Implementation of an operation for a class (Implementation Phase), Polymorphic operation: The same operation applies to many different classes.

Object Model

Page 63: 2004 by SEC Chapter 3 Requirements Engineering

63

2004 by SEC

Identify the boundaries of the system– What object is inside, what object is outside?

Identify the important entities in the system– Learn about problem domain: Observe your client

– Take the flow of events and find participating objects in use cases (Scenarios and use cases)

– Apply design patterns

– Nouns are good candidates for classes

Class Identification

Page 64: 2004 by SEC Chapter 3 Requirements Engineering

64

2004 by SEC

Class Types

Entity Objects: represent the persistent information (Application domain objects, “Business objects”)

Boundary Objects: represent the interaction between the user and the system

Control Objects: represent the control tasks performed by the system

<<entity>>student

<<entity>>teacher

<<entity>>employee

<<control>>ChangeDateControl

<<boundary>>LCDDisplayBoundary

<<boundary>>ButtonBoundary

Page 65: 2004 by SEC Chapter 3 Requirements Engineering

65

2004 by SEC

Requirement StatementsProper noun

Improper noun

Doing verb

being verb

having verb

modal verb

adjective

transitive verb

intransitive verb

Model componentobject

class

method

inheritance

aggregation

constraint

attribute

method

method (event)

Example

Jim Smith

toy, car

buy, recommend

is-a (kind-of)

has an

must be

3 years old

enter

depends on

Mapping Requirement Statements to Object Model Components

Page 66: 2004 by SEC Chapter 3 Requirements Engineering

66

2004 by SEC

Behavioral Model

Indicate different states of the system

Specify events that cause the system to change state

Build State charts

Page 67: 2004 by SEC Chapter 3 Requirements Engineering

67

2004 by SEC

A Modeling Example: A Banking System

Foo

Balance

CustomerId

Deposit()Withdraw()GetBalance()

Class Identification: Name of Class, Attributes and Methods

Page 68: 2004 by SEC Chapter 3 Requirements Engineering

68

2004 by SEC

Naming

Foo

Balance

CustomerId

Deposit()Withdraw()GetBalance()

Account

Balance

CustomerId

Deposit()Withdraw()GetBalance()

“Dada”

Balance

CustomerId

Deposit()Withdraw()GetBalance()

Page 69: 2004 by SEC Chapter 3 Requirements Engineering

69

2004 by SEC

Finding New Objects

Account

BalanceAccountId

Deposit()Withdraw()GetBalance()

Customer

NameCustomerId

Iterate on Names, Attributes and Methods

Bank

Name

Page 70: 2004 by SEC Chapter 3 Requirements Engineering

70

2004 by SEC

Finding Associations

Account

BalanceAccountId

Deposit()Withdraw()GetBalance()

Customer

NameCustomerId

Bank

Name

•Iterate on Names, Attributes and Methods •Find Associations between Objects •Label the associations •Determine the multiplicity of the associations

Has*

Page 71: 2004 by SEC Chapter 3 Requirements Engineering

71

2004 by SEC

Finding Generalization

MortgageAccount

Withdraw()

*Account

BalanceAccountId

Deposit()Withdraw()GetBalance()

Customer

NameCustomerId

Bank

Name

Has*

SavingAccount

Withdraw()

CheckingAccount

Withdraw()

Page 72: 2004 by SEC Chapter 3 Requirements Engineering

72

2004 by SEC

Categorization

Don’t put too many classes into the same package:

72 or even 52

Page 73: 2004 by SEC Chapter 3 Requirements Engineering

73

2004 by SEC

3.4 Data Modeling and OOA

Page 74: 2004 by SEC Chapter 3 Requirements Engineering

74

2004 by SEC

OOA vs. Data Modeling Data modeling is for data-intensive applications

OOA:

E-R Diagram Semantic Data Modeling

OOA

OOPL

• Services• Message between objects• classification & inheritance

Page 75: 2004 by SEC Chapter 3 Requirements Engineering

75

2004 by SEC

OOA vs. Data Modeling

Similarity : describe relationships between objects

Differences:– data modeling does not concern how these relationships are

achieved

– data modeling without concern for the processing that must be applied to transform the data

in general, no concept of methods is considered

Data objects can be defined in terms of a set of attributes– encapsulates data only, that is , no reference within a data object to

operations that act on the data

Page 76: 2004 by SEC Chapter 3 Requirements Engineering

76

2004 by SEC

OOA vs. Data Modeling (cont’d)

Data object attributes– data object tables : normalization result in minimum redundancy,

that is , the amount of information that we need to maintain to satisfy a particular problem is minimized.

Normalization rules

(1) only one value for each attribute

(2) attributes should contain no internal structure

Page 77: 2004 by SEC Chapter 3 Requirements Engineering

77

2004 by SEC

Exercises Both SA and OOA offer the mechanism for the partition. Do

they support the interactions between the different levels?

Compare the similarity and differences between the data modeling and object-oriented modeling.