l18-s1 getting started 2003 sjsu -- cmpe advanced object-oriented analysis & design dr. m.e....

24
2003 SJSU -- CmpE L18-S1 Getting Started Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad

Post on 22-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

2003 SJSU -- CmpE L18-S1 Getting Started

Advanced Object-Oriented Analysis & Design

Dr. M.E. Fayad, Professor

Computer Engineering Department, Room #283I

College of Engineering

San José State University

One Washington Square

San José, CA 95192-0180

http://www.engr.sjsu.edu/~fayad

2003 SJSU – CmpE --- M.E. Fayad L18-S2 Getting Started

2

Lesson 18:Getting Started

2003 SJSU – CmpE --- M.E. Fayad L18-S3 Getting Started

Lesson Objectives

Objectives

3

Learn how to deal with:

The identification of OO Artifacts

Test Objects/Classes

Create CRC Cards

Create Use Case Diagrams

Write Use Cases

Class Diagrams

Meta-Models

2003 SJSU – CmpE --- M.E. Fayad L18-S4 Getting Started

FamilyReunion

Quotation and Bidding System

Internet Based Supply Chain Management System

Virtual Private Network

4

First Part: Identification Process

2003 SJSU – CmpE --- M.E. Fayad L18-S5 Getting Started

FamilyReunion

Quotation and Bidding System

Internet Based Supply Chain Management System

Virtual Private Network5

Second Part: Use Case Diagrams

2003 SJSU – CmpE --- M.E. Fayad L18-S6 Getting Started

FamilyReunion

Quotation and Bidding System

Internet Based Supply Chain Management System

Virtual Private Network6

Third Part: Use Cases

2003 SJSU – CmpE --- M.E. Fayad L18-S7 Getting Started

FamilyReunion

Quotation and Bidding System

Internet Based Supply Chain Management System

Virtual Private Network7

Fourth Part: CRC Cards

2003 SJSU – CmpE --- M.E. Fayad L18-S8 Getting Started

FamilyReunion

Quotation and Bidding System

Internet Based Supply Chain Management System

Virtual Private Network8

Fifth Part: Class Diagrams

2003 SJSU – CmpE --- M.E. Fayad L18-S9 Getting Started

Create Class Diagrams

Correct Existing Models

Evaluate Models

9

Design Session Problems

2003 SJSU – CmpE --- M.E. Fayad L18-S10 Getting Started

10

StudentPrincipal Teacher

School

0..*0..*

0..* 0..*

PersonBook0..* Borrow

Room

Playground

Swing

0..*

0..*1..*

DoorChair1..*0..*

SchoolBoard1..*

CafeteriaClassroom Restroom …..

Computer

Desk

Ruler

0..*

0..*

0..*

2003 SJSU – CmpE --- M.E. Fayad L18-S11 Getting Started

11

File System

*

*

*

*

*

*

*

*

0,1

Drive

manufacturer

Data file Directory file

number of filessymbolic link?

list()change working directory()ASCII file

print()

Executable file

execute()

Directory

File system

File

nameowerpermissionslast updatesizechecksum

create()copy()delete()rename()compress()uncompress()compare()

Disk

capacity

Track

Sector

2003 SJSU – CmpE --- M.E. Fayad L18-S12 Getting Started

12

Building

Store* *

* *

*

*

*

*

*

*

**

0,1

Store

Store

Alarm

enable()disarm()on()off()ringing()

Smoke alarm

Burglqar alarm Kitchen

Building

addressnumber rooms

Sink

CheeseRefrigerator

temperaturevolume

Bread Cabinet

Window

open()close()

Door

open()close()

Table

Light

Switch

on()off()

Room

dimensionscolornumber doorsnumber windowsnumber lights

Freezer

temperaturevolume

Ice

2003 SJSU – CmpE --- M.E. Fayad L18-S13 Getting Started

13

Meta Models: Abstract Class

1 .. * 1 .. *

1 .. *1 .. *Has subclasses

Has direct instances

Has subclasses

Class

Leaf classNon-leaf concreate class

Abstract class

Concrete class

Instance

subclass subclass

superclass

superclass

1 .. *

2003 SJSU – CmpE --- M.E. Fayad L18-S14 Getting Started

14

Meta Models: Program (1)

then-action

target

0,1

0,1

0,1

*

*

*

*

*

* * * * * *

*

*

*

*

Invoke

0,1

condition

parameter

else-action

2

2

2

Data definition

Block

Statement

Assignment statement

Conditional statement

Iteration statement

Procedure call

Expression

string

evaluate()

Variable

namedata type

Function reference

name

Argument list

name of arguments

Formal argument

name

Program

namepurposedata last modifiedauthor

compile()link()execute()debug()

FunctionDefine

2003 SJSU – CmpE --- M.E. Fayad L18-S15 Getting Started

15

** *

*

*

*

* *

*

*

**

*

*

**

*

*

*

*

*

*

11

1Expression

string

evaluate()

Expression relateOper expression

Term Parenthesized expression

Relational operator

Expression+ expression

Factor Expression- expression

Expression* expression

Unary Expression/ expression

+expression Terminal -expression

Arithmetic operator

Constant Variable

name

data type()

Function reference

name

Program (2)

2003 SJSU – CmpE --- M.E. Fayad L18-S16 Getting Started

16

Meta Models: Undirected Graph (1)

ab

c

d

e

2003 SJSU – CmpE --- M.E. Fayad L18-S17 Getting Started

17

Meta Models: Undirected Graph (2) Several variations are possible, depending on your viewpoint -- Here is the first

model

UndirectedGraph

Vertex Edge

* **2

2003 SJSU – CmpE --- M.E. Fayad L18-S18 Getting Started

18

Meta Models: Undirected Graph (3)

UndirectedGraph

Vertex Edge

* *2Incidence*

2003 SJSU – CmpE --- M.E. Fayad L18-S19 Getting Started

19

Meta Models: Directed Graph (1)

ab

c

d

e

2003 SJSU – CmpE --- M.E. Fayad L18-S20 Getting Started

20

Meta Models: Directed Graph (2)

DirectedGraph

Edge Vertex

* *

** From

To

Using two associations

2003 SJSU – CmpE --- M.E. Fayad L18-S21 Getting Started

21

Meta Models: Directed Graph (3)

DirectedGraph

Edge Vertex

* **

Using a qualified association

end

2003 SJSU – CmpE --- M.E. Fayad L18-S22 Getting Started

1. Define and create meta models for any 5 concepts that you are familiar with..

2. Define: Metamodels, metaclass, metadata.

22

Discussion Questions

2003 SJSU – CmpE --- M.E. Fayad L18-S23 Getting Started

Design Heuristics

TOP

More on Class Diagrams

23

Questions for the Next Lecture

2003 SJSU – CmpE --- M.E. Fayad L18-S24 Getting Started

Task 1: Viewing your work on Project 1

Task 2: Design Session P2 on Meta Models

24

Tasks for Next Lecture