introduction to object-oriented analysis and design (ooad)€¦ · introduction to object-oriented...

20
Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office (812) 877-8974 Cell (937) 657-3885 Email: [email protected]

Upload: dangtruc

Post on 04-Jun-2018

238 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

Introduction to

Object-Oriented Analysis

and Design (OOAD)

CSSE 574: Week 1, part 2

Steve Chenoweth

Phone: Office (812) 877-8974

Cell (937) 657-3885 Email: [email protected]

Page 2: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

2

Agenda

Some Design Perspectives

Bridging from CSSE 571 to

CSSE 574 Software Architecture and Design 1

Or, from Requirements to Design

Understanding Larman Book’s

Organization

Introduction to Object-Oriented Analysis

and Design

Class Exercise

Some UML Perspectives

Homework Assignment

Page 3: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

Why is Software Design Important?

Size

Complexity

Constraints

Performance

Communication

3

Page 4: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

4

Thinking at the Right Level

Abstraction - hiding irrelevant

details to the current design

Process of component identification

is top-down, decomposing the

system into successively smaller,

less complex components

Process of integration, which is

bottom-up, building (composing) the

target system by combining

components in useful ways

Why do you suppose that Larman

does not stress learning UML? ©2000-2002 McQuain WD & Keller BJ

Page 5: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

5

Elaboration and Refinement…

Starting with Abstract Requirements

Successively Elaborate and Refine them into

specifications, models, and ultimately

implementation

Page 6: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

Key Questions

1. How should responsibilities be allocated

to classes?

2. How should objects collaborate?

3. What classes should do what?

Guided by patterns

Page 7: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

7

Topics Covered in Book

Topics and Skills

UML notation

Requirements

analysis

Principles and

guidelines

Patterns

Iterative

development with

an agile Unified

Process

OOA/D

http://www.craiglarman.com/wiki/images/4/43/Craig_larman_head.JPG

Page 8: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

8

Assigning Object Responsibilities

A critical ability in Object-Oriented

development is to skillfully assign

responsibilities to software objects.

Page 9: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

Analysis versus Design

Analysis

Investigation of the problem and requirements,

rather than a solution

Design

A conceptual solution,

rather than its implementation

Excludes low level details

–Often represented in code

9

Page 10: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

10

Analysis and Design Concepts

Plane

tailNumber

public class Plane

{

private String tailNumber;

public List getFlightHistory() {...}

}

domain concept

visualization of

domain concept

representation in an

object-oriented

programming language

Analysis Concept Design Concept

Page 11: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

Quick Example: Dice

Define Use Cases

Play a dice game: Players requests to roll the

dice. System presents results: If the dice face

value totals seven, player wins; otherwise

player loses

Define a Domain Model

Assign Object Responsibilities, Draw

Interaction Diagrams

Define Design Class Diagrams

11

Page 12: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

12

Domain Model for a Dice Game

Player

name

DiceGame

Die

faceValue

Rolls

Plays

Includes

2

2

1

1

1

1

Page 13: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

13

Sequence diagram for Play Dice Game

Page 14: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

14

Design Class Diagram for Dice Game

2

Die

faceValue : int

getFaceValue() : int

roll()

DiceGame

die1 : Die

die2 : Die

play()

1

How does it differ from domain model?

Page 15: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

15

Exercise: Dog E-Doctor System

Dog

E-Doctor

System

Dog & Client

Information,

Inquiries,

Appointments

Dog Healthcare Advice,

Veterinary Appointments,

Client/Dog Database,

Dog Services Database

Health and Care Guidelines

Scheduling Criteria

Client Guidelines

Context: Dog Owners who require health advice or veterinary services for their dog(s).

Purpose: To provide convenient dog healthcare advice and service appointments via the web.

1. Read the problem scope and use case on the handout

2. Answer the quiz questions

Page 16: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

Unified Modeling Language (UML)

Grady Booch

Jim Rumbaugh

Ivar Jacobson

Page 17: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

17

Three Ways to Apply UML

Sketch

Blueprint

Executable programming language

Page 18: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

Three Perspectives to Apply UML

Conceptual perspective

Software specification perspective

Software implementation perspective

18

Page 19: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

19

Abstract Requirements to Concrete Systems

Abstract

Requirements

Concrete

Implementation

Computational

Independent

Model

Platform

Independent

Model

Platform

Specific

Model Analysis/

Conceptual

Classes

(Domain Model)

Software

Classes

(Design Class

Diagrams)

Implementation

Classes

(Language)

Page 20: Introduction to Object-Oriented Analysis and Design (OOAD)€¦ · Introduction to Object-Oriented Analysis and Design (OOAD) CSSE 574: Week 1, part 2 Steve Chenoweth Phone: Office

20

Larman’s Own Case Studies

NextGen Point of Sale (POS) System

Monopoly Game

The case study is organized in three iterations Each iteration conducts analysis and design on the

features for that current software release