Refining the Requirements Model Roman Kontchakov Birkbeck, - - PowerPoint PPT Presentation

refining the requirements model
SMART_READER_LITE
LIVE PREVIEW

Refining the Requirements Model Roman Kontchakov Birkbeck, - - PowerPoint PPT Presentation

Information Systems Concepts Refining the Requirements Model Roman Kontchakov Birkbeck, University of London Based on Chapter 7, 8, 14 and 20 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design Using UML, (4th Edition),


slide-1
SLIDE 1

1

Information Systems Concepts

Refining the Requirements Model

Roman Kontchakov

Birkbeck, University of London

Based on Chapter 7, 8, 14 and 20 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design Using UML, (4th Edition), McGraw Hill, 2010

slide-2
SLIDE 2

2 n Software and Specification Reuse

n Section 20.2 (pp. 585 – 586) n Section 8.2 (pp. 234 – 237) n Section 8.4 (pp. 246 – 247) n Section 8.5.1 – 8.5.2 (pp. 252 – 253)

n Adding Further Structure (to Class Diagrams)

n Section 8.3.1 – 8.3.3 (pp. 237 – 244) n Section 14.4.4 (pp. 409 – 410)

Outline

slide-3
SLIDE 3

3

Stereotypes: Entity Classes

Campaign Campaign title campaignStartDate campaignFinishDate getCampaignAdverts( ) addNewAdvert( ) <<entity>> Campaign title campaignStartDate campaignFinishDate getCampaignAdverts( ) addNewAdvert( ) n Stereotypes differentiate the roles of objects

n Entity objects represent information and behaviour in the

application domain

slide-4
SLIDE 4

4

Stereotypes: Boundary Classes

User Interface::AddAdvertUI User Interface::AddAdvertUI startInterface( ) assignStaff( ) selectClient( ) selectCampaign( ) <<boundary>> User Interface::AddAdvertUI startInterface( ) assignStaff( ) selectClient( ) selectCampaign( )

n Stereotypes differentiate the roles of objects

n Boundary objects model interaction between the system and

actors (and other systems), e.g., user interface

slide-5
SLIDE 5

5

Stereotypes: Control Classes

AddAvert Control::AddAdvert showClientCampaigns( ) showCampaignAdverts( ) createNewAdvert( ) <<control>> Control::AddAdvert showClientCampaigns( ) showCampaignAdverts( ) createNewAdvert( ) n Stereotypes differentiate the roles of objects

n Control objects co-ordinate and control other objects

(often correspond to Use Cases)

slide-6
SLIDE 6

6

Association Classes

slide-7
SLIDE 7

7 n The arguments for reuse are

n partly economic

n saving time and effort in software development including

software testing and quality assurance

n partly concerned with quality

n fewer defects

n partly about business flexibility

n faster time to market

Why Reuse?

slide-8
SLIDE 8

8

How O-O Contributes to Reuse

n Inheritance and Encapsulation

n Two main forms of abstraction that O-O relies on to achieve

reuse

n Components n Patterns

slide-9
SLIDE 9

9

Reuse: Encapsulation

n allows one class or component to be replaced by another

with different internal details, as long as they adhere to the same external interface

n thus classes or components can be used in systems for which

they were not originally designed

n a group of classes can be encapsulated through aggregation

  • r composition to become a reusable subassembly

Universal Serial Bus (USB)

http://en.wikipedia.org/wiki/Universal_Serial_Bus Plug and Play

slide-10
SLIDE 10

10

Reuse: Inheritance

n encourages identifying those aspects of a design or

specification that has general application to a variety of situations or problems

n allows the creation of new specialised classes when needed,

with little effort

“Do not reinvent the wheel!”

http://en.wikipedia.org/wiki/Wheel http://images.google.co.uk/images?q=wheel&hl=en same circular form and central shaft

slide-11
SLIDE 11

11

Reuse: Components

n For example, a house (bricks, tiles, doors, windows, pipes,

etc.), a home theatre (a big screen TV, a DVD player , a decoder , an amplifier , speakers, etc.), …

n Software development has concentrated on inventing new

  • solutions. Recently, the emphasis has shifted. Much software

is now assembled from components that already exist.

slide-12
SLIDE 12

12

Reuse: Patterns

n next year

, Information Systems Management

slide-13
SLIDE 13

13

Adding Generalization Structure

n A generalization structure can be added when two

classes are similar in most respects, but differ in some details such as

n behaviour (operations or methods) n data (attributes) n associations with other classes

slide-14
SLIDE 14

14

Adding Generalization Structure

0..* 1..* allocated

Superclass associations are inherited by subclasses

calculateBonus () StaffMember {abstract} staffName staffNo staffStartDate calculate Bonus () assignNewStaffGrade () getStaffDetails () CreativeStaff qualification assignStaffContact () Grade gradeName AdminStaff calculateBonus ()

A superclass Two subclasses

0..* 1..* allocated

Superclass associations are inherited by subclasses

calculateBonus () StaffMember {abstract} staffName staffNo staffStartDate calculate Bonus () assignNewStaffGrade () getStaffDetails () CreativeStaff qualification assignStaffContact () Grade gradeName AdminStaff calculateBonus () AdminStaff calculateBonus ()

A superclass Two subclasses

slide-15
SLIDE 15

15

Liskov Substitution Principle

n In object interactions, it should be possible to treat a

derived object as if it were a base object without integrity problems.

n If the principle is not applied, then it may be possible to

violate the integrity of the derived object. Prof Barbara Liskov

2009 A. M. Turing Award winner

slide-16
SLIDE 16

16

Disinheritance of debit() means that the left-hand hierarchy is not Liskov compliant

Liskov Substitution Principle

ChequeAccount accountName balance credit() debit() MortgageAccount interestRate calculateInterest()

  • debit()

Account accountName balance credit() ChequeAccount debit() MortgageAccount interestRate calculateInterest() Restructuring to satisfy LSP

slide-17
SLIDE 17

17

Aggregation and Composition

n Two special types of association

n Aggregation represents a whole-part relationship between

classes

n Composition expresses a similar relationship but differs in

showing a stronger form of ownership by the whole

n Each part may belong to only one whole at a time. n When the whole is destroyed, so are all its parts.

slide-18
SLIDE 18

18

n A student could be in a number of modules n If a module is cancelled, students are not destroyed

Notation: Aggregation

Module Student

0..* 1..*

unfilled diamond denotes aggregation

slide-19
SLIDE 19

19

Meal Ingredient

1..* 1

filled diamond denotes composition

Notation: Composition

n An ingredient is in only one meal at a time n If you drop your meal on the floor

, you probably lose the ingredients too

slide-20
SLIDE 20

20

Take Home Messages

n Software and Specification Reuse

n Why Reuse n How O-O Contributes to Reuse

n Adding Further Structure (to Class Diagrams)

n Generalization/Specialization

n Liskov Substituion Principle

n Aggregation and Composition