structural modeling and analysis

29
STRUCTURAL MODELING AND ANALYSIS By: JIGAR M. MAKHIJA

Upload: jigar-makhija

Post on 09-Feb-2017

69 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Structural modeling and analysis

STRUCTURAL MODELING AND ANALYSIS

By: JIGAR M. MAKHIJA

Page 2: Structural modeling and analysis

Structural modeling

• It can be referred as “Thing”.• Structural modeling shows how this Things are

related with each other.

Thing

Class Interface Object Package

Page 3: Structural modeling and analysis

What is an Object?

• A self contained entity with well defined characteristics

Eg: Entity=Book; Characteristics=page no, author , publisher,

price etc.

Page 4: Structural modeling and analysis

Type of Objects

Objects

Physical & Conceptual

Domain & Implementatio

n

Active & Passive

Page 5: Structural modeling and analysis

1. Physical & Conceptual :

– Tangible & Intangible objects.– Physical objects are the things which are visible

and that can be touched . E.g.: ATM.– Conceptual objects are the things which we can’t

see normally. E.g.: Card Strip Reader.

Page 6: Structural modeling and analysis

2. Domain & Implementation :– The objects identified from the real world are

domain objects.e.g. : Bank Accounts, ATM, Customers Etc.– The objects which are not related to the real

world entities are implementation objects.e.g. : Error Logs, Transaction Records .

Page 7: Structural modeling and analysis

3. Active & Passive:– The objects which can change its state without

any external command are Active objects .e.g. : Timers & Clocks.– The objects which can change its state unless any

external command is received are known by Passive objects.

e.g. : Properties of bank account.

Page 8: Structural modeling and analysis

What is Class?

• A set of similar objects.• It is combination of properties and methods

that are necessary to the system.properties=attributes;methods=operations;

Bank Account

- Name- Balance

+ Debit(Amt)+ Credit(Amt)

UML NOTATION

Page 9: Structural modeling and analysis

• Attributes:– Properties of a class.– Attributes consist of Name & its Value along with its

Type. E.g. : Int sum=100;

• Operations:– A set of functions to provide services in software

system. – Operations are similar to functions that consist of

parameters and return values.e.g. : withdraw(amt) , getBalance() .

Page 10: Structural modeling and analysis

Encapsulation

• Information Hiding.• Objects are like Black boxes.• The implementation of objects are hidden

from those who use them (End Users).• But, creator or developer knows the details of

internal construction of that object.

Page 11: Structural modeling and analysis

Inheritance

• Attributes and operations common to group of subclass are attached to superclass and inherited by its subclasses.

• Each subclass may also include new feature of its own.

• Properties:

Generalization

Specialization

Page 12: Structural modeling and analysis

•The purpose of this property is to distribute the commonalities from the superclass among a group of similar subclasses.

Generalization

•It allows subclasses to extend the functionalities of their superclass.•A subclass can introduce new operations and attributes of its own.

Specialization

Page 13: Structural modeling and analysis

Abstract Classes

• An abstract class consist of operations without their actual implementation .

• An operations without the implementation (body) is called abstract operations.

• A class can be specified as abstract by writing name in italics. E.g. Shape

Page 14: Structural modeling and analysis

Polymorphism

• Polymorphism is the ability for a variable to hold objects of its own class and subclasses at runtime.

Page 15: Structural modeling and analysis

Role• Each end of association has a role.

Multiplicity• Multiplicity refers to the number of objects

associated with a given object.

Association• It represents binary relationships among

classes.• Represented by line.

Person Company1..n 1Works forEmployee Employer

Multiplicity

Role

Page 16: Structural modeling and analysis

Qualification

• It serves as names or keys that are part of association and are used to select objects at the other end of association.

Person Bank

Person Bank

0..n 0..n

Account No0..1 0..n

Page 17: Structural modeling and analysis

Reflexive Association

• A reflexive association is an association that relates one object of a class to another object of the same class.

N-ary Association• A relationship involving three classes is referref to

as an ternary relationship, and one involving many classes is referred to as an n-ary relationship.

Page 18: Structural modeling and analysis

Association Classes

• Associations that include additional attributes which do not naturally belong to the objects involved in the associations.

Person Company

Position

-title-starting_Date

-salary

0..n 0..nWorkFor

Page 19: Structural modeling and analysis

Aggregation

• Aggregation is a stronger form of association.• It represent the “has-a or part-of”

relationship.Company Division

1..n

Department

1..n

Page 20: Structural modeling and analysis

Composition

• Composition is a stronger form of aggregation.• It represent the “part-of” relationship.

Company Division

1..n

Department

1..n

Page 21: Structural modeling and analysis

Constraints and Notes

• Constraints are relation between signs & symbols of UML element that allow the inclusion of new rules or the modification of existing ones.

• Constraints are represented by label in curly brackets {constraint name}.

{Constraints}

Page 22: Structural modeling and analysis

UML Notation for Structural Modeling

Class :

Interface:

Component

Component:

Interface

Page 23: Structural modeling and analysis

UML Notation for Structural Modeling

Node:

Constraint:

Association:

Aggregation:

Generalization:

Page 24: Structural modeling and analysis

Heuristics in using Structural Analysis

• Do not attempt to develop a single giant class diagram.

• Use model management constructs such as package, subsystems.

• Consider both logical & physical aspects.• Use data or middleware for communication

among major subsystems whenever possible.

Page 25: Structural modeling and analysis

Heuristics in using Structural Analysis

• Make Design Patterns flexible and adaptable.• Apply domain analysis such as textual analysis,

documentation reviews to identify reusable components.

• Inter-play top-down approach & bottom-up approach.

• Use packages to organize the domain classes incrementally as development progresses.

Page 26: Structural modeling and analysis

Heuristics in using Structural Analysis

• Conduct use case analysis to yield missing pieces in structural model.

• Review whether a particular class is becoming too large.

Page 27: Structural modeling and analysis

Domain Modeling and Analysis Process

• Before domain analysis is conducted we need to understand the problem of domain of the system.

• The output of the domain analysis is domain class model which describes the classes and their relationships.

• The domain class model consist of class diagrams, a data dictionary describing the classes and their associations (relationships ).

Page 28: Structural modeling and analysis

Developing Domain Class Models

1. Preparing the problem statement.2. Identifying the objects and classes using textual

analysis.3. Developing a data dictionary.4. Identifying associations between classes.5. Identifying attributes of classes and association classes.6. Structuring classes using inheritance.7. Verifying access path for likely queries.8. Iterating and refining the model.

Page 29: Structural modeling and analysis

…That’s all for today.