modeling- object, dynamic and functional

50
1 Modeling- Object and Dynamic Modeling Rajani Bhandari Senior Project Manager HCL Technologies

Upload: rajani-bhandari

Post on 24-Apr-2015

1.442 views

Category:

Technology


2 download

DESCRIPTION

Give details about OOPS concept and Modeling concept "How to design system". Also it gives breif on layered architecture and reverse engineering.

TRANSCRIPT

Page 1: Modeling- Object, Dynamic and Functional

1

Modeling- Object and Dynamic Modeling

Rajani Bhandari

Senior Project Manager

HCL Technologies

Page 2: Modeling- Object, Dynamic and Functional

2

Topics will be covered

What is an Object What is Object Oriented Programming Why Modeling Required Modeling techniques Object Modeling Dynamic Modeling Functional ModelingLayered Architecture

Page 3: Modeling- Object, Dynamic and Functional

3

What is Object

Object : An object is a real life example of material thing which can be seen and felt. The object have specific behavior and attributes

Example any real life thing. Some of them as followsStudentCarBanking systemBody

Object can be categorized, described, organized, combined, manipulated and created.

Page 4: Modeling- Object, Dynamic and Functional

4

Example of Objects

BookTitle

Author

Publisher

Open ()

Close()

Read()

PersonName

Address

Phone

ChangeName()

ChangeAddress()

ChangePhone()

Book

Physics

Book

Biology

Person 1

Ramesh

Objects of Book or person

Person 2

Suresh

Page 5: Modeling- Object, Dynamic and Functional

5

What is Object Oriented Programming

Page 6: Modeling- Object, Dynamic and Functional

6

Object Oriented Programming

Four main object-oriented programming concepts.Data AbstractionEncapsulationInheritancePolymorphism

OOPS revolves around objects and classesClass may be seen as Structures and functions

Page 7: Modeling- Object, Dynamic and Functional

7

Shape

Rectangle

Square

Circle

Eclipse

Showing inheritance Specialization

Abstract class

Specialized class

Page 8: Modeling- Object, Dynamic and Functional

8

Vehicle Example Showing inheritance generalization

Vehicle

Car

Petrol Electric

Truck Bus

Page 9: Modeling- Object, Dynamic and Functional

9

Why Modeling Required

Page 10: Modeling- Object, Dynamic and Functional

10

Why modeling

Before constructing a building, a designer first build a model. To test a physical entity before actually building it. To set the stage for communication between customers and developers. For visualization i.e. for finding alternative representations. For reduction of complexity in order to understand it.

Page 11: Modeling- Object, Dynamic and Functional

11

Why Model

c lie n t ,u s e rs

a rc h ite c t d e v e lo p e rs

a p p e a ra n c e ,b e h a v io u r

c o n s tru c t io n ,c o -o p e ra t io n

a rc h ite c tu ra ld e s ig n

v is u a lis e s p re s c r ib e s

re q u ire m e n ts s o lu t io n s

c re a te sa s s e s s a s s e s s

Page 12: Modeling- Object, Dynamic and Functional

12

Advantage of Modeling

A model provides a means for conceptualization and communication of ideas in a precise and unambiguous form.

A model is an abstraction for the purpose of understanding it before building it.

So a model is an abstraction that hides the non-essential characteristics of a system and highlights those characteristics, which are pertinent to understand it.

Page 13: Modeling- Object, Dynamic and Functional

13

Modeling Techniques

Page 14: Modeling- Object, Dynamic and Functional

14

OMT stages and Models

Analysis - Model of real-world situation

- What ?

System Design - Overall architecture (sub-systems)

Object Design - Refinement of Design

- Algorithms/data structures to implement each class

Implementation - Translation of object classes and

relationships to a particular object-oriented language

time

System

Ob

ject M

od

el

- Sta

tic structure of o

bjects and

their re

latio

nships (ob

ject dia

gram

)

Dyn

amic M

od

el

- Co

ntrol aspects o

f the system

(state diagra

ms)

Fu

nctio

nal M

od

el- D

ata value

transfo

ramtio

ns (da

taflow dia

gram

s)

Page 15: Modeling- Object, Dynamic and Functional

15

Types of Model

Object model The object model represents the static and most stable phenomena in the modeled domain. Main concepts are classes and associations, with attributes and operations. Aggregation and generalization (with multiple inheritance) are predefined relationships.

Dynamic model The dynamic model represents a state/transition view on the model. Main concepts are states, transitions between states, and events to trigger transitions. Actions can be modeled as occurring within states.

Functional model The functional model represents flow of values from external inputs, through operations and internal data stores, to external outputs.

Page 16: Modeling- Object, Dynamic and Functional

16

Object Modeling

Page 17: Modeling- Object, Dynamic and Functional

17

Object Modeling

The object model provides the framework into which the other models are placed.

Build an Object Model: Identify object classes. Develop a data dictionary for classes, attributes, and associations. Add associations between classes. Add attributes for objects and links. Organize and simplify object classes using inheritance. Group classes into modules, based on close coupling and related function.

Page 18: Modeling- Object, Dynamic and Functional

18

Object and Class

A class is defined as Collection of similar objects. It is a template where basic characteristics of set of objects is defined.

Defines attributes and Operations i.e. member variables and functions.

Defining a class does not define any object, but it only creates a template.

For creating object basically create instance of class.

Page 19: Modeling- Object, Dynamic and Functional

19

Association relation

Professor

Ramesh

Book

Physics

Wrote Department

ScienceCourses

Offers

One to one relation

Person

RameshPassport

1 0..1Airplane Passengers

1 *

One to many relationBinary

Page 20: Modeling- Object, Dynamic and Functional

20

Association relation with Qualifier

Bank Account No Person

Page 21: Modeling- Object, Dynamic and Functional

21

Aggregation

If two parts are linked but they have their individuality then its association and if two parts have whole-part relationship then it is aggregation.

Like of whole is affected part will be affected

Page 22: Modeling- Object, Dynamic and Functional

22

Document

Paragraph

Sentence

Word Character

Aggregation Example

Page 23: Modeling- Object, Dynamic and Functional

23

Aggregation Example

ATM

Cash Dispenser Deposit Slot

PPT

Slide

Page 24: Modeling- Object, Dynamic and Functional

24

Modeling of Library System

First we create object Model Identify class Identify its relationship Its attributes and behavior

Page 25: Modeling- Object, Dynamic and Functional

25

ATM Machine designing

Screen Transaction

Keypad ATMCash

Dispenser

Withdrawal

Deposit

Slots

Deposit

Bank

Database

Balance

Inquiry

Account

Page 26: Modeling- Object, Dynamic and Functional

26

ATM objects Relationship

Screen

Transaction

Keypad

ATM

Cash

Dispenser

Withdrawal

Deposit

Slots

Deposit

Bank

Database Balance

Inquiry

AccountAuthenticate

User

1

1

Modifies

0…*

0…*

1

1

1

1

111

0…*

1

1

0…*

Page 27: Modeling- Object, Dynamic and Functional

27

Library System Class

Books

User

Publisher

Librarian

Student Faculty

Reference

Books

General

Books

0..*+1

Author 1Issues

Orders

+1

+1…*

RequestsManages

+1

+1…*

Page 28: Modeling- Object, Dynamic and Functional

28

Dynamic Modeling

Page 29: Modeling- Object, Dynamic and Functional

29

Dynamic Model

Build a Dynamic Model: Prepare scenarios of typical interaction sequences. Identify events between objects and prepare an event trace for each

scenario. Prepare an event flow diagram for the system. Develop a state diagram for each class that has important dynamic behavior. Check for consistency and completeness of events shared among the state

diagrams.

Page 30: Modeling- Object, Dynamic and Functional

30

Identify Use Cases for library class

Inquiry for Membership

Search Book

Request for book issue

Request for book return Pay Fine

Page 31: Modeling- Object, Dynamic and Functional

31

Identify use case for library class

Issue member card

Cancel membership

Issue Book

Return Book

Maintain Book Record

Update member card

Update Book

Remove

Book

Add Book

Page 32: Modeling- Object, Dynamic and Functional

32

ATM define Class attributes and behaviour

Screen

Display Message()

Deposit

Double: Amount

Execute()

Withdrawal

Double: Amount

Execute()

Balance Enquiry

Execute()

Bank database

Authenticate User()

getBalance()

Credit()Debit()

Keypad

GetInput()

Transaction

Int:Account Number

Execute()

getAccountNumber()

Account

Int: Account NumberInt PinDouble:Balance

validatePin()getBalance()Credit()Debit()

Cash dipenser

Int: amount

DispenseCash()IsCashAvailable()

Page 33: Modeling- Object, Dynamic and Functional

33

Define classes attributes and Behavior

Book

ID: IntName: CharAuthor: CharYear of Publication: CharPrice: CharStatus: CharChar: Category

Add New Books()DeleteBooks()UpdateBookDetails()DisplayBookDetails()UpdateStatus()

Librarian

ID: IntName: Char

IssueBooks()ReturnBooks()SearchBooks()VerifyMember()PayBills()OrderBooks()IssueIDCards()ManageBookReecord

Publisher

Int :Publisher IDChar : Publisher NameChar : Publisher AddressInt: Publisher No.

AddPub()ModifyPub()DeletePub()OrderStatus()

User

Int :User IDChar : User NameChar : User AddressInt: Phone No.

IssueBooks()ReturnBooks()PayFine()AddNewUser()DeleteUser()UpdateDetails()

Page 34: Modeling- Object, Dynamic and Functional

34

ATM state machine

Page 35: Modeling- Object, Dynamic and Functional

35

State Machine

Issued

Issue

process()

Search

Book()

Book Can have following states: AvailableIssuedReturnedMissing

Request

[Book

Available]

Cancelled

Request

Page 36: Modeling- Object, Dynamic and Functional

36

Member Librarian Book

Issue Book

[status == true]

Search Book

Book

Found

Set Status

SetStatus

Issued(book iD)Book

Issued

Sequence Model

Page 37: Modeling- Object, Dynamic and Functional

37

Function Modeling

Page 38: Modeling- Object, Dynamic and Functional

38

Functional Modeling

Build a Functional Model: Identify input and output values. Use data flow diagrams as needed to show functional dependencies. Describe what each function does. Identify constraints. Specify optimization criteria.

Page 39: Modeling- Object, Dynamic and Functional

39

Function Modeling

Data Flow Diagrams are composed of the four basic symbols – external entities, processes, data stores and data flow - as discussed below.

The External Entity symbol represents sources of data to the system or destinations of data from the system.

The Process symbol represents an activity that transforms or manipulates the data (combines, reorders, converts, etc.).

The Data Store symbol represents data that is not moving (delayed data at rest).

The Data Flow symbol represents movement of data.

Page 40: Modeling- Object, Dynamic and Functional

40

DFD for issuing pay check

DFD for a system that pays to worker:Input Data Flow: Timesheet Hours(Source is Worker)Basic Output: Pay checkProcess: Employee's record is retrieved, using the employee ID, which is contained in the timesheet. From the employee record, the rate of payment and overtime are obtained.

Page 41: Modeling- Object, Dynamic and Functional

41

Layered Architecture

Page 42: Modeling- Object, Dynamic and Functional

42

Layered Architecture

UI layer

(Forms or view displayed at front end)

Business Layer

(Contains business logic)

Data Layer

(Manages DB, or File operation)

DB File

Send Reqeust

Receive Response

Set/Get Data Output Data/ reesponse

Page 43: Modeling- Object, Dynamic and Functional

43

Advantages of Layered Architecture

Reduced complexityEasy to add or modify functionalityEasy to Debug and Test Increase Reusability

Page 44: Modeling- Object, Dynamic and Functional

44

Reverse Engineering

Page 45: Modeling- Object, Dynamic and Functional

45

Reverse Engineering

It is a technique to understand through analysis of its structure, Function and operation.

The concept behind reverse-engineering—breaking something down in order to understand it, build a copy or improve it.

It is easy to learn by putting things apart and rejoining that Helps in Estimate costs.Reverse Engg is done because documentation is not available

Page 46: Modeling- Object, Dynamic and Functional

46

Forward vs Reverse Engineering

Analysis

Design

Implementation

Reverse engineering

Forward

engineering

Documentation

Debugging is important

factor in RE

Page 47: Modeling- Object, Dynamic and Functional

47

Benefits for RE

Understand existing designQuality improvementSoftware reuse No need to start from scratchTo examin how product works , what components it consists ,

estimate costs.Reverse Engg is done because documentation is not available

Page 48: Modeling- Object, Dynamic and Functional

48

Out Come of reverse engineering

Document explaining: Code structure – classes, structures and its relation Functionality – Understanding functionality of module Input for Estimation Improvement points

Page 49: Modeling- Object, Dynamic and Functional

52

Questions ???

Page 50: Modeling- Object, Dynamic and Functional

53

Thanks