Object Oriented Analysis and Design

by

Digmabar Powar
SS ZG514 Object Oriented Analysis and Design

6/24/2013

1

Text Books:
1 Larman, Craig, Applying UML and Patterns: An Introduction to Object-Oriented Analysis, Pearson Education, 3nd Ed., 2008. 2 Grady Booch et al., Unified Modeling Language User Guide, Pearson Education, 2009. 3 Ali Bahrami, Object Oriented Systems Development using Unified Modeling Language, McGraw Hill, 2010
SS ZG514 Object Oriented Analysis and Design

6/24/2013

2

Time EC-2 EC-3 Mid-Semester Test (Closed Book) Comprehensive Exam (Open Book) Details will be announced on LMS Taxila website 2 Hours 3 Hours Details will be announced on LMS Taxila website Sunday. Date. Evaluation Component & Type of Examination EC-1 Assignment/Quiz Duration Weightage 10% Day. Session. 08/04/2012 (FN) 9 AM – 12 Noon 30% 60% 6/24/2013 SS ZG514 Object Oriented Analysis and Design 3 .Evaluation Components EC No. 12/02/2012 (FN) 10 AM – 12 Noon Sunday.

Course Review  Concepts of Object Orientation  UML notations  Design Patterns  Object Oriented Analysis and Design using UML and Patterns  Case Studies 6/24/2013 SS ZG514 Object Oriented Analysis and Design 4 .

leave him kill him. not leave him (miss interpreted) 6/24/2013 SS ZG514 Object Oriented Analysis and Design 5 .Civil engineering Projects Vs Software Projects Design document Vs Textual document Example: kill him not.

Software extensibility is easy. OO analysis centers on objects which combines data and methods. OO view more closely reflects the real world where humans are used to think in terms of things which possess both attributes and behaviours. SS ZG514 Object Oriented Analysis and Design 6/24/2013 6 . OO provides reuse possibility from the class hierarchy views of the system.Object-Oriented Vs Traditional analysis      OO technique provides a more consistent approach to system modelling.

The Basic Principles of Object Orientation Four basic principles:  Abstraction  Encapsulation  Modularity  Hierarchy 6/24/2013 SS ZG514 Object Oriented Analysis and Design 7 .

 Allows complexity to be more easily managed 6/24/2013 SS ZG514 Object Oriented Analysis and Design 8 . relative to the perspective of the viewer. [Boo94] Key concepts:  Concentrating only on essential characteristics  Abstraction is relative to the perspective of the viewer  Many different views of the same object are possible.Abstraction An abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of objects and thus provide crisply defined conceptual boundaries.

Example: Abstraction 6/24/2013 SS ZG514 Object Oriented Analysis and Design 9 .

Encapsulation  Encapsulation is the practice of including in an object everything it needs hidden from other objects. The internal state is usually not accessible by other objects. Key concepts:  Packaging structure and behavior together in one unit  Makes objects more independent  Objects exhibit an interface through which others can interact with it  Hides complexity from an object’s clients 6/24/2013 SS ZG514 Object Oriented Analysis and Design 10 .

Modularity Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules. Module: a collection of related classes of objects Key concepts:  Modules are cohesive (performing a single type of tasks)  Makes modules more reusable  Modules are loosely coupled (highly independent)  Makes modules more robust and maintainable SS ZG514 Object Oriented Analysis and Design 6/24/2013 11 .

Example: Modularity 6/24/2013 SS ZG514 Object Oriented Analysis and Design 12 .

Hierarchy Hierarchy is a ranking or ordering of abstractions OR Organizing things into different levels of abstraction Types of hierarchies:  Class  Aggregation  Containment  Inheritance  Partition  Specialization SS ZG514 Object Oriented Analysis and Design 6/24/2013 13 .

Example: Hierarchy 6/24/2013 SS ZG514 Object Oriented Analysis and Design 14 .

Basic Concepts of Object Orientation       Object Class Attribute Operation Component Package 6/24/2013 SS ZG514 Object Oriented Analysis and Design 15 .

object is an instance of a class 6/24/2013 SS ZG514 Object Oriented Analysis and Design 16 . unit.  Also. or entity. either real or abstract. with a well-defined role in the problem domain. identifiable item.Object  An object represents an individual. Or  An "object" is anything to which a concept applies.

etc)  A conceptual entity (A chemical process)  A software entity (stack. fan. man. linked list) 6/24/2013 SS ZG514 Object Oriented Analysis and Design 17 .An object can be  A physical entity (car. queue.

Objects have the following qualities:  Identity: Objects are distinguishable from one another  Behavior: Objects can perform tasks  State: Objects store information that can vary over time 6/24/2013 SS ZG514 Object Oriented Analysis and Design 18 .

Class     A class is a blueprint that describes an object and defines attributes and operations for the object Classes use abstraction to make available only the elements essential to defining the object Classes use encapsulation to enforce an abstraction Simple terms: It is a collection of objects 6/24/2013 SS ZG514 Object Oriented Analysis and Design 19 .

Relations between Objects and Classes  A class is an abstract definition of an object   It defines the structure and behavior of each object in the class It serves as a template for creating the objects  Objects are grouped into classes 6/24/2013 SS ZG514 Object Oriented Analysis and Design 20 .

6/24/2013 SS ZG514 Object Oriented Analysis and Design 21 .do Do not support inheritance Default access type is private The convention is to use Use classes when we require data structure when the purpose is to abstraction and. perhaps group data inheritance. properties. and methods Extensible by inheritance Default access type is public Classes .Difference between Structures and Classes Structures Can define data members.

Attributes: It describes the state (data) of an object Operation: Define its behavior  What an object is capable of doing 6/24/2013 SS ZG514 Object Oriented Analysis and Design 22 .

Component:   A non-trivial. nearly independent and replaceable part of a system that fulfills a clear function in the context of a well defined architecture. A component may be    A source code component A run time component An executable component 6/24/2013 SS ZG514 Object Oriented Analysis and Design 23 .

A model element which can contain other model elements.Package:   A package is a general purpose mechanism for organizing elements into groups. A component may be     A source code component A run time component An executable component 6/24/2013 SS ZG514 Object Oriented Analysis and Design 24 .

Strengths of Object Orientation:  Facilitates architectural and code reuse  Models more closely reflect the real world    More accurately describe corporate data and processes Decomposed based on natural partitioning Easier to understand and maintain  Stability  A small change in requirements does not mean massive changes in the system under development SS ZG514 Object Oriented Analysis and Design 25 6/24/2013 .

6/24/2013 SS ZG514 Object Oriented Analysis and Design 26 .Summary:    The basic principles of object orientation The basic concepts of object orientation The strengths of object orientation.