22
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 7 Requirements and Domain Classes SWE 316: Software Design and Architecture Understand distinctions: OO analysis vs. design Traditional application development vs. OO analysis & design Domain vs. non-domain classes Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission. Ch 13

Lecture 7 Requirements and Domain Classes

  • Upload
    cicada

  • View
    46

  • Download
    0

Embed Size (px)

DESCRIPTION

SWE 316: Software Design and Architecture. Lecture 7 Requirements and Domain Classes. Ch 13. Understand distinctions: OO analysis vs. design Traditional application development vs. OO analysis & design Domain vs. non-domain classes. - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Obj

ectiv

es

Lecture 7Requirements and Domain Classes

SWE 316: Software Design and Architecture

Understand distinctions: OO analysis vs. design Traditional application development

vs. OO analysis & design Domain vs. non-domain classes

Adapted from Software Design: From Programming to Architecture by Eric J. Braude (Wiley 2003), with permission.

Ch 13

Page 2: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Process Phases Discussed in This ChapterRequirements

AnalysisDesign

Implementation

ArchitectureFramework Detailed Design

xKey: = secondary emphasisx = main emphasis

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 2/22

Page 3: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Relation of software architecture to other development tasks

Applied Software Architecture by C. Hofmeister et al. 2000

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 3/22

Page 4: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

The Activities of Application Development

1. Gather requirementsSpecify Customer-oriented requirements

specsSpecify Developer-oriented requirement

specs2. Create design

Select architectureSpecify detailed design

3. Implement design

Sec 13.1

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 4/22

Page 5: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Characteristics of OO Analysis & Design Approach is initially through the application’s

domain classes (its “ingredients”) -- rather than its required functionality Like starting a recipe by listing the ingredients Typically obtain from introducing use cases

then transforming these into sequence diagrams

Introduces domain classes at requirements time

Remaining classes at design time

Supports iterative development processes

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 5/22

Page 6: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

The basic OOA&D approach

Emphasis is on objects (state and behavior) [ingredients]

What is the application about? Individual words (nouns) that answer the question

are the domain classes

13.1.1

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 6/22

Page 7: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

The Basic OOA&D Approach

1. State the main use cases

2. Convert the use cases to sequence diagrams

3. Select the resulting (“domain”) classes

refine

select

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 7/22

Page 8: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Jacobson et al. list of the differences between OO analysis and designAnalysis Design1. Conceptual & abstract 1. Concrete: implementation

blueprint2. Applicable to several designs

2. Specific for an implementation

3. «control», «entity» & «boundary» stereotypes

3. No limit on class stereotypes

4. Less formal 4. More formal5. Less expensive to develop 5. More expensive to develop

( 5×)6. Outlines the design 6. Manifests the design 7. Emerges from conceptual thinking

7. May use tools (e.g. visual, round-trip engineering)

8. Few layers 8. Several layers9. Relatively unconstrained 9. Constrained by the

analysis & architecture

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 8/22

Page 9: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Seek domain classes from other sources Gather domain classes

Develop use cases with customer

Convert use cases to sequence diagrams

Introduce design patternsor components

Finalize design(class model, use case model, ….)

I. Requirements analysis phase

II. Architecture phase

III. Detailed Design phase

Determine architectureConsider Framework

(existing, modified, or new)

OOA&D Roadmap (to be explained)

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 9/22

Page 10: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Case Study: Encounter (1/2)Summary Specification:

Role-playing game which simulates all or part of the lifetime of the player's character.

Game characters not under the player’s control called "foreign" characters.

Game characters have a number of qualities such as strength, speed, patience etc. 

Each quality has a value Characters engage each other when in the same

area. 

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 10/22

Page 11: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Case Study: Encounter (2/2)Summary Specification:

The result of an engagement depends on the area in which it takes place, and on the values of the characters’ relevant qualities

Players may reallocate the values of their qualities when the foreign character is absent

Reallocation takes effect after a delay Success is measured by life points accumulated,

by living as long as possible etc.

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 11/22

Page 12: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Encounter Area Configuration

Dressingroom

Courtyard

Dungeon Study

Key: = connection

Livingroom

Kitchen

Foreign Character Freddie’s

Image

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 12/22

Page 13: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Obtaining Domain Classes

13.3.1 - Use Case Requirements Description

13.3.2 - Converting Use Cases to Sequence Diagrams

13.3.3 - Harvesting Domain Classes from Sequence Diagrams

13.3

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 13/22

Page 14: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

OOA&D Roadmap: Parts Discussed in This Section

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 14/22

Page 15: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Use Case Requirements Description

Engageforeign

character

player

Set rules

actors

Travel toadjacent area

Initialize

1. Application displays player’s main character in the dressing room.2. Application displays a window for setting his character's qualities. 3. Player allocates the qualities of his main character. 4. Player chooses an exit from the dressing room.

Initialize

Use case titles

Use case detail

Designer

“Initialize” Use Case for Encounter Case Study13.3.1

OO Analysis and Design

Obtaining Domain Classes

1- Use Cases

2- Sequence Diagrams 3- Harvesting 15/22

Page 16: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Travel To Adjacent Area Use Case

Initialize

Encounter

Travel toadjacent area

Set rules

Travel to Adjacent Area1. Player hits hyperlink connecting displayed area to adjacent area.2. Application displays the indicated adjacent area, including the player’s character.

Engageforeign

character

Designer

player

OO Analysis and Design

Obtaining Domain Classes

1- Use Cases

2- Sequence Diagrams 3- Harvesting 16/22

Page 17: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Converting:Use Cases to Sequence Diagrams 13.3.2

Player

:Encounter-Game

main playercharacter:

Player Character

1*.1 create and display

5. move

Sequence Diagram for Initialize Use Case

* Numbering keyed to use case

1.2 create and display

2. create and display

3.2 set quality values

:Player qualitywindow

dressing room: Area

4. select exit for character

3.1 set quality values

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 17/22

Page 18: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

User:Connection

Hyperlink

1.1 hit

1.2 display other area

:AreaConnection

:Area

2.1 display

2.2 display

:PlayerCharacter

Sequence Diagram for Travel to Adjacent Area Use CaseOO Analysis and

DesignObtaining Domain

Classes 1- Use Cases 2- Sequence Diagrams 3- Harvesting 18/22

Page 19: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Harvesting Domain Classes from Sequence Diagrams13.3.

3

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams3-

Harvesting19/22

Page 20: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Classes in Initialize Sequence DiagramEncounterGame

- a class with a single object PlayerCharacter

- with object mainPlayerCharacter

Area - with object dressingRoom, and

PlayerQualityWindow- a GUI class included to complete the use case.

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams3-

Harvesting20/22

Page 21: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Harvesting Classes From the Sequence Diagrams

Area

Player ForeignCharacter

EncounterCharacter

GameCharacterEngagement

EncounterAreaConnection

EngagementDisplay

ConnectionHyperlink

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams3-

Harvesting21/22

Page 22: Lecture 7 Requirements and Domain Classes

SWE 316: Software Design and Architecture – Dr. Khalid Aljasser

Summary of This Chapter OO Analysis = Requirements analysis + Domain

class selection Product = Complete requirements document + Domain

class model + Basic sequence diagrams OO Design = All other activities except coding

Product = Complete detailed design ready for coding Traditional application development: Function-

oriented OO analysis & design: “Ingredients-oriented” Domain classes = “Ingredients”

Obtained via use cases sequence diagrams, and Brainstorming / Editing process

Use domain classes to organize requirements

OO Analysis and Design

Obtaining Domain Classes 1- Use Cases 2- Sequence

Diagrams 3- Harvesting 22/22