1 of 30

Object-Oriented Analysis and Design:

Dr. Sangeeta Arora

(Head Of Deptt)

PG Deptt of Computer Science And IT

2 of 30

Object-Oriented Analysis

  • Object–Oriented Analysis (OOA) is the procedure of identifying software engineering requirements and developing software specifications in terms of a software system’s object model, which comprises of interacting objects.
  • The main difference between object-oriented analysis and other forms of analysis is that in object-oriented approach, requirements are organized around objects, which integrate both data and functions.

3 of 30

The primary tasks in object-oriented analysis (OOA) are −�1.Identifying objects�2.Organizing the objects by creating object model diagram�3.Defining the internals of the objects, or object attributes�4.Defining the behavior of the objects, i.e., object actions�5.Describing how the objects interact�

4 of 30

Object-Oriented Design :�Object–Oriented Design (OOD) involves implementation of the conceptual model produced during object-oriented analysis. �In OOD, concepts in the analysis model, which are technology−independent, are mapped onto implementing classes, constraints are identified and interfaces are designed, resulting in a model for the solution domain, i.e., a detailed description of how the system is to be built on concrete technologies.�

5 of 30

The implementation details generally include −�Restructuring the class data (if necessary),�Implementation of methods, i.e., internal data structures and algorithms,�Implementation of control, and�Implementation of associations.

6 of 30

Objects and Classes�The concepts of objects and classes are intrinsically linked with each other and form the foundation of object–oriented paradigm.�

Object :

  • An object is a real-world element in an object–oriented environment that may have a physical or a conceptual existence. Each object has −
  • Identity that distinguishes it from other objects in the system.
  • State that determines the characteristic properties of an object as well as the values of the properties that the object holds.
  • Behavior that represents externally visible activities performed by an object in terms of changes in its state.

7 of 30

Class�A class represents a collection of objects having same characteristic properties that exhibit common behavior. It gives the blueprint or description of the objects that can be created from it. Creation of an object as a member of a class is called instantiation. Thus, object is an instance of a class.�The constituents of a class are −A set of attributes for the objects that are to be instantiated from the class. Generally, different objects of a class have some difference in the values of the attributes. Attributes are often referred as class data.��A set of operations that portray the behavior of the objects of the class. Operations are also referred as functions or methods.

8 of 30

Example:�Let us consider a simple class, Circle, that represents the geometrical figure circle in a two–dimensional space. The attributes of this class can be identified as follows −�x–coord, to denote x–coordinate of the center�y–coord, to denote y–coordinate of the center�a, to denote the radius of the circle�Some of its operations can be defined as follows −�findArea(), method to calculate area�findCircumference(), method to calculate circumference�scale(), method to increase or decrease the radius�

9 of 30

Abstraction �Whenever we build applications, we do so in layers. Here is the layered architecture of a simple web application:�

10 of 30

An advantage of doing so is that the Web layer does not need to know anything about the Data layer. It is abstracted away from the Data layer. All that it needs to be concerned with, is that it can delegate requests to the Business layer, and the business layer would take care of rest of the flow. Layering in an application is, in a way, abstracting away complexity.

11 of 30

collaboration among objects:�The Unified Modeling Language (UML) is a graphical language for OOAD that gives a standard way to write a software system’s blueprint. �It helps to visualize, specify, construct, and document the artifacts of an object-oriented system. It is used to depict the structures and the relationships in a complex system.

12 of 30

13 of 30

Conceptual Model of UML�The Conceptual Model of UML encompasses three major elements �*Basic building blocksRules�*Common mechanisms�*Basic Building Blocks�The three building blocks of UML are −�*Things�*Relationships�*Diagrams�*Things

14 of 30

Polymorphism :�Polymorphism is originally a Greek word that means the ability to take multiple forms. In object-oriented paradigm, polymorphism implies using operations in different ways, depending upon the instance they are operating upon. �Polymorphism allows objects with different internal structures to have a common external interface. Polymorphism is particularly effective while implementing inheritance.

15 of 30

16 of 30

Encapsulation and Data HidingEncapsulation:Encapsulation is the process of binding both attributes and methods together within a class. Through encapsulation, the internal details of a class can be hidden from outside. It permits the elements of the class to be accessed from outside only through the interface provided by the class.�

17 of 30

Data Hiding

  • Typically, a class is designed such that its data (attributes) can be accessed only by its class methods and insulated from direct outside access. This process of insulating an object’s data is called data hiding or information hiding.

Example

  • In the class Circle, data hiding can be incorporated by making attributes invisible from outside the class and adding two more methods to the class for accessing class data, namely −
  • setValues(), method to assign values to x-coord, y-coord, and a
  • getValues(), method to retrieve values of x-coord, y-coord, and a

18 of 30

Object Modelling :Object modelling develops the static structure of the software system in terms of objects. It identifies the objects, the classes into which the objects can be grouped into and the relationships between the objects. It also identifies the main attributes and operations that characterize each class.��The process of object modelling can be visualized in the following steps −��1.Identify objects and group into classes�2.Identify the relationships among classes�3.Create user object model diagram�4.Define user object attributes�5.Define the operations that should be performed on the classes�6.Review glossary

19 of 30

Dynamic Modelling

  • After the static behavior of the system is analyzed, its behavior with respect to time and external changes needs to be examined. This is the purpose of dynamic modelling.
  • Dynamic Modelling can be defined as “a way of describing how an individual object responds to events, either internal events triggered by other objects, or external events triggered by the outside world”.

The process of dynamic modelling can be visualized in the following steps −

  • Identify states of each object
  • Identify events and analyze the applicability of actions
  • Construct dynamic model diagram, comprising of state transition diagrams
  • Express each state in terms of object attributes

20 of 30

Functional Modelling :

  • Functional Modelling is the final component of object-oriented analysis.
  • The functional model shows the processes that are performed within an object and how the data changes as it moves between methods. It specifies the meaning of the operations of object modelling and the actions of dynamic modelling.
  • The functional model corresponds to the data flow diagram of traditional structured analysis.

21 of 30

The process of functional modelling can be visualized in the following steps :

  • Identify all the inputs and outputs
  • Construct data flow diagrams showing functional dependencies
  • State the purpose of each function
  • Identify constraints
  • Specify optimization criteria

22 of 30

The stages for object–oriented design can be identified as −

  • Definition of the context of the system
  • Designing system architecture
  • Identification of the objects in the system
  • Construction of design models
  • Specification of object interfaces

23 of 30

System Design

Object-oriented system design involves defining the context of a system followed by designing the architecture of the system.

  • Context − The context of a system has a static and a dynamic part. The static context of the system is designed using a simple block diagram of the whole system which is expanded into a hierarchy of subsystems.
  • System Architecture − The system architecture is designed on the basis of the context of the system in accordance with the principles of architectural design as well as domain knowledge.

24 of 30

Object design includes the following phases −

  • Object identification
  • Object representation, i.e., construction of design models
  • Classification of operations
  • Algorithm design
  • Design of relationships
  • Implementation of control for external interactions
  • Package classes and associations into modules

25 of 30

Object Identification:

  • The first step of object design is object identification. The objects identified in the object–oriented analysis phases are grouped into classes and refined so that they are suitable for actual implementation.

The functions of this stage are −

  • Identifying and refining the classes in each subsystem or package
  • Defining the links and associations between the classes
  • Designing the hierarchical associations among the classes, i.e., the generalization/specialization and inheritances
  • Designing aggregations

26 of 30

Object Representation

Once the classes are identified, they need to be represented using object modelling techniques. This stage essentially involves constructing UML diagrams.

There are two types of design models that need to be produced −

  • Static Models − To describe the static structure of a system using class diagrams and object diagrams.
  • Dynamic Models − To describe the dynamic structure of a system and show the interaction between classes using interaction diagrams and state–chart diagrams.

27 of 30

The following tasks are performed regarding operations −

  • The state transition diagram of each object in the system is developed.
  • Operations are defined for the events received by the objects.
  • Cases in which one event triggers other events in same or different objects are identified.
  • The sub–operations within the actions are identified.
  • The main actions are expanded to data flow diagrams.

28 of 30

The various things that may be done for design optimization are −

  • Add redundant associations
  • Omit non-usable associations
  • Optimization of algorithms
  • Save derived attributes to avoid re-computation of complex expressions

29 of 30

Design Documentation :

  • In designing software that is being developed by a number of developers
  • In iterative software development strategies
  • In developing subsequent versions of a software project
  • For evaluating a software
  • For finding conditions and areas of testing
  • For maintenance of the software.

30 of 30

THANK YOU