Unit 2 - Object Oriented Analysis and Design - WWW - Rgpvnotes.in
Unit 2 - Object Oriented Analysis and Design - WWW - Rgpvnotes.in
UNIT-II
Software Development Life Cycle, SDLC for short, is a well-defined, structured sequence of stages in
software engineering to develop the intended software product.
SDLC Activities:
SDLC provides a series of steps to be followed to design and develop a software product efficiently. SDLC
framework includes the following steps:
Requirement Gathering:
This step onwards the software development team works to carry on the project. The team holds
discussions with various stakeholders from problem domain and tries to bring out as much information as
possible on their requirements. The requirements are contemplated and segregated into user
requirements, system requirements and functional requirements. The requirements are collected using a
number of practices as given -
o studying the existing or obsolete system and software,
o conducting interviews of users and developers,
o referring to the database or
o Collecting answers from the questionnaires.
Feasibility Study:
After requirement gathering, the team comes up with a rough plan of software process. At this step the
team analyzes if software can be made to fulfill all requirements of the user and if there is any possibility of
software being no more useful. It is found out, if the project is financially, practically and technologically
feasible for the organization to take up. There are many algorithms available, which help the developers to
conclude the feasibility of a software project.
System Analysis:
At this step the developers decide a roadmap of their plan and try to bring up the best software model
suitable for the project. System analysis includes Understanding of software product limitations, learning
system related problems or changes to be done in existing systems beforehand, identifying and addressing
the impact of project on organization and personnel etc. The project team analyzes the scope of the
project and plans the schedule and resources accordingly.
Software Design:
Next step is to bring down whole knowledge of requirements and analysis on the desk and design the
software product. The inputs from users and information gathered in requirement gathering phase are the
inputs of this step. The output of this step comes in the form of two designs; logical design and physical
design. Engineers produce meta-data and data dictionaries, logical diagrams, data-flow diagrams and in
some cases pseudo codes.
Coding:
This step is also known as programming phase. The implementation of software design starts in terms of
writing program code in the suitable programming language and developing error-free executable
programs efficiently.
Testing:
An estimate says that 50% of whole software development process should be tested. Errors may ruin the
software from critical level to its own removal. Software testing is done while coding by the developers and
thorough testing is conducted by testing experts at various levels of code such as module testing, program
testing, product testing, in-house testi g a d testi g the p odu t at use ’s e d. Ea l dis overy of errors
and their remedy is the key to reliable software.
Integration:
Software may need to be integrated with the libraries, databases and other program(s). This stage of SDLC
is involved in the integration of software with outer world entities.
Implementation:
This means installing the software on user machines. At times, software needs post-installation
configurations at user end. Software is tested for portability and adaptability and integration related issues
are solved during implementation.
Disposition:
As time elapses, the software may decline on the performance front. It may go completely obsolete or may
need intense up gradation. Hence a pressing need to eliminate a major portion of the system arises. This
phase includes archiving data and required software components, closing down the system, planning
disposition activity and terminating system at appropriate end-of-system time.
Object–Oriented Analysis (OOA) is the procedure of identifying software engineering requirements and
de elopi g soft a e spe ifi atio s i te s of a soft a e s ste ’s o je t odel, hi h o p ises of
interacting objects.
The primary tasks in object-oriented analysis (OOA) are:
Find the objects
Organize the objects
Describe how the objects interact
Define the behavior of the objects
Define the internals of the 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. They are
modeled after real-world objects that the system interacts with. In traditional analysis methodologies, the
two aspects - functions and data - are considered separately.
Controlling Events:
During system design, the events that may occur in the objects of the system need to be identified and
appropriately dealt with.
An event is a specification of a significant occurrence that has a location in time and space.
There are four types of events that can be modeled, namely:
Signal Event: A named object thrown by one object and caught by another object.
Call Event: A synchronous event representing dispatch of an operation.
Time Event: An event representing passage of time.
Change Event: An event representing change in state.
Waterfall Model:
Waterfall model is the simplest model of software development paradigm. It says the all the phases of
SDLC will function one after another in linear manner. That is, when the first phase is finished then only the
second phase will start and so on.
This model assumes that everything is carried out and taken place perfectly as planned in the previous
stage and there is no need to think about the past issues that may arise in the next phase. This model does
not work smoothly if there are some issues left at the previous step. The sequential nature of model does
not allow us go back and undo or redo our actions.
This model is best suited when developers already have designed and developed similar software in the
past and are aware of all its domains
In the system analysis or object-oriented analysis phase of software development, the system
requirements are determined, the classes are identified and the relationships among classes are identified.
The three analysis techniques that are used in conjunction with each other for object-oriented analysis are
object modelling, dynamic modelling, and functional modeling.
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:
Identify objects and group into classes
Identify the relationships among classes
Create user object model diagram
Define user object attributes
Define the operations that should be performed on the classes
Review glossary
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.
D a i Modelli g a e defi ed as a a of des i i g ho a i di idual o je t espo ds to e e ts,
eithe i te al e e ts t igge ed othe o je ts, o e te al e e ts t igge ed the outside o ld .
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
Validate the state–transition diagrams drawn
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.
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
Advantages Disadvantages
Focuses on data rather than the procedures as in Functionality is restricted within objects. This may
Structured Analysis. pose a problem for systems which are intrinsically
procedural or computational in nature.
The principles of encapsulation and data hiding It cannot identify which objects would generate an
help the developer to develop systems that cannot optimal system design.
be tampered by other parts of the system.
The principles of encapsulation and data hiding The object-oriented models do not easily show the
help the developer to develop systems that cannot communications between the objects in the system.
be tampered by other parts of the system.
It allows effective management of software All the interfaces between the objects cannot be
complexity by the virtue of modularity. represented in a single diagram.
It can be upgraded from small to large systems at a
greater ease than in systems following structured
analysis.
It is based upon functionality. The overall purpose is The initial cost of constructing the system is
identified and then functional decomposition is done for high, since the whole system needs to be
developing the software. The emphasis not only gives a designed at once leaving very little option to
better understanding of the system but also generates add functionality later.
more complete systems.
The specifications in it are written in simple English It does not support reusability of code. So,
language, and hence can be more easily analyzed by non- the time and cost of development is
technical personnel. inherently high.
Phase of OMT:
The OMT methodology covers the full software development life cycle. The methodology has the following
phase.
1. Analysis - Analysis is the first phase of OMT methodology. The aim of analysis phase is to build a
model of the real world situation to show its important properties and domain. This phase is
concerned with preparation of precise and correct modelling of the real world. The analysis phase
starts with defining a problem statement which includes a set of goals. This problem statement is
then expanded into three models; an object model, a dynamic model and a functional model. The
object model shows the static data structure or skeleton of the real world system and divides the
whole application into objects. In others words, this model represents the artifacts of the system.
The dynamic model represents the interaction between artifacts above designed represented as
events, states and transitions. The functional model represents the methods of the system from the
data flow perspective. The analysis phase generates object model diagrams, state diagrams, event
flow diagrams and data flow diagrams.
2. System design - The system design phase comes after the analysis phase. System design phase
determines the overall system architecture using subsystems, concurrent tasks and data storage.
During system design, the high level structure of the system is designed. The decisions made during
system design are:
o The system is organized in to sub-systems which are then allocated to processes and tasks,
taking into account concurrency and collaboration.
o Persistent data storage is established along with a strategy to manage shared or global
information.
o Boundary situations are checked to help guide trade off priorities.
3. Objects design - The object design phase comes after the system design phase is over. Here the
implementation plan is developed. Object design is concerned with fully classifying the existing and
remaining classes, associations, attributes and operations necessary for implementing a solution to
the problem. In object design:
o Operations and data structures are fully defined along with any internal objects needed for
implementation.
o Class level associations are determined.
o Issues of inheritance, aggregation, association and default values are checked.
Object Model:
o It represents the static structure of the application.
o It specifies to whom it happens to.
o Operations in an object model corresponds to events in dynamic model and functions in functional
model.
o It is represented using class diagrams.
Dynamic Model:
o It represents the essential behavior of the application.
o It specifies when it happens.
o Dynamic model describes the control structure of the objects. It defines decisions which are
dependents of object values and which can cause action to change object values and invoke their
functions.
o It is represented using state diagrams.
Functional Model:
o It represents what the application does and not how it does.
o It specifies what happens.
o It describes functions to be invoked by operations in object model and actions in dynamic models.
o It is represented using data flow diagrams.
Context DFD is the entrance of a data flow model. It contains one and only one process and does not show
any data store.
Level 1 DFD
The figure below shows the level 1 DFD, which is the decomposition (i.e. break down) of the Food Ordering
System process shown in the context DFD. Read through the diagram and then we will introduce some of
the key concepts based on this diagram.
As a general modeling approach, OMT may be used to model all types of work.
OMT proposes three main types of models:
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.
Generalization and aggregation (concurrency) are predefined relationships.
The dynamic model represents the time–dependent aspects of a system. It is concerned with the temporal
changes in the states of the objects in a system. The main concepts are:
o State, which is the situation at a particular condition during the lifetime of an object
o Transition, a change in the state
o Event, an occurrence that triggers transitions
o Action, an uninterrupted and atomic computation that occurs due to some event.
o Concurrency of transitions.
A state machine models the behavior of an object as it passes through a number of states in its lifetime
due to some events as well as the actions occurring due to the events. A state machine is graphically
represented through a state transition diagram.
Parts of a state:
o Name: A string differentiates one state from another. A state may not have any name.
o Entry/Exit Actions: It denotes the activities performed on entering and on exiting the state.
o Internal Transitions: The changes within a state that do not cause a change in the state.
o Sub–states: States within states.
Transition:
A transition denotes a change in the state of an object. If an object is in a certain state when an event
occurs, the object may perform certain activities subject to specified conditions and change the state. In
this ase, a state−t a sitio is said to have occurred. The transition gives the relationship between the first
state and the new state. A transition is graphically represented by a solid directed arc from the source state
to the destination state.
The five parts of a transition are:
o Source State: The state affected by the transition.
o Event Trigger: The occurrence due to which an object in the source state undergoes a transition if
the guard condition is satisfied.
o Guard Condition: A Boolean expression which if True, causes a transition on receiving the event
trigger.
o Action: An un-interruptible and atomic computation that occurs on the source object due to some
event.
o Target State: The destination state after completion of transition.
Example:
Suppose a person is taking a taxi from place X to place Y. The states of the person may be: Waiting (waiting
for taxi), Riding (he has got a taxi and is travelling in it), and Reached (he has reached the destination). The
following figure depicts the state transition.
Internal events are those that pass from one object to another object within a system. For example, stack
overflow, a divide error, etc.
Deferred Events:
Deferred events are those which are not immediately handled by the object in the current state but are
lined up in a queue so that they can be handled by the object in some other state at a later time.
Event Classes:
Event class indicates a group of events with common structure and behavior. As with classes of objects,
event classes may also be organized in a hierarchical structure. Event classes may have attributes
associated with them, time being an implicit attribute. For example, we can consider the events of
departure of a flight of an airline, which we can group into the following class:
Flight_Departs (Flight_No, From_City, To_City, Route)
Activity:
Activity is an operation upon the states of an object that requires some time period. They are the ongoing
executions within a system that can be interrupted. Activities are shown in activity diagrams that portray
the flow from one activity to another.
Action:
An action is an atomic operation that executes as a result of certain events. By atomic, it is meant that
actions are un-interruptible, i.e., if an action starts executing, it runs into completion without being
interrupted by any event. An action may operate upon an object on which an event has been triggered or
on other objects that are visible to this object. A set of actions comprise an activity.
Scenario:
Scenario is a description of a specified sequence of actions. It depicts the behavior of objects undergoing a
specific action series. The primary scenarios depict the essential sequences and the secondary scenarios
depict the alternative sequences.
Concurrency of Events:
In a system, two types of concurrency may exist. They are:
System Concurrency:
Here, concurrency is modelled in the system level. The overall system is modelled as the aggregation of
state machines, where each state machine executes concurrently with others.
Concurrency within an Object
Here, an object can issue concurrent events. An object may have states that are composed of sub-states,
and concurrent events may occur in each of the sub-states.
Concepts related to concurrency within an object are as follows:
(a) Simple and Composite States
A simple state has no sub-structure. A state that has simpler states nested inside it is called a composite
state. A sub-state is a state that is nested inside another state. It is generally used to reduce the complexity
of a state machine. Sub-states can be nested to any number of levels.
Composite states may have either sequential sub-states or concurrent sub-states.
(b) Sequential Sub-states
In sequential sub-states, the control of execution passes from one sub-state to another sub-state one after
another in a sequential manner. There is at most one initial state and one final state in these state
machines.
Functional Modelling gives the process perspective of the object-oriented analysis model and an overview
of what the system is supposed to do. It defines the function of the internal processes in the system with
the aid of Data Flow Diagrams (DFDs). It depicts the functional derivation of the data values without
indicating how they are derived when they are computed, or why they need to be computed.
Features of a DFD:
Processes:
Processes are the computational activities that transform data values. A whole system can be visualized as
a high-level process. A process may be further divided into smaller components. The lowest-level process
may be a simple function.
Representation in DFD: A process is represented as an ellipse with its name written inside it and contains a
fixed number of input and output data values.
Example: The following figure shows a process Compute_HCF_LCM that accepts two integers as inputs and
outputs their HCF (highest common factor) and LCM (least common multiple).
In the next level DFD, as shown in the following figure, the major processes of the system are identified,
the data stores are defined and the interaction of the processes with the actors and the data stores are
established.
In the system, three processes can be identified, which are:
Register Customers
Process Sales
Ascertain Gifts
The data stores that will be required are:
Customer Details
Sales Details
Gift Details
Classification of Operations:
In this step, the operation to be performed on objects are defined by combining the three models
developed in the OOA phase, namely, object model, dynamic model, and functional model. An operation
specifies what is to be done and not how it should be done.
The following tasks are performed regarding operations:
o The state transition diagram of each object in the system is developed.
o Operations are defined for the events received by the objects.
o Cases in which one event triggers other events in same or different objects are identified.
o The sub–operations within the actions are identified.
o The main actions are expanded to data flow diagrams.
OBJECT DIAGRAM
An object diagram models a group of objects and their links at a point of time. It shows the instances of
the things in a class diagram. Object diagram is the static part of an interaction diagram. Example: The
following figure shows an object diagram of a portion of the class diagram of the Banking System.
STATE DIAGRAMS:
The state diagram in the Unified Modeling Language is essentially a Hare state chart with standardized
notation which can describe many systems, from computer programs to business processes.
In UML 2 the name has been changed to State Machine Diagram. The following are the basic notational
elements that can be used to make up a diagram:
Filled circle, representing to the initial state, hollow circle containing a smaller filled circle, indicating the
final state (if any)and Rounded rectangle, denoting a state. Top of the rectangle contains a name of the
state. Can contain a horizontal line in the middle, below which the activities that are done in that state are
Indicated Arrow, denoting transition. The name of the event (if any) causes this transition labels the arrow
body. A guard expression may be added before a "/" and enclosed in square-brackets (event Name [guard
Expression]), denoting that this expression must be true for the transition to take place. If an action is
Performed during this transition, it is added to the label following a "/" (event Name [guard
Expression]/action).
Thick horizontal line with either x>1 lines entering and 1 line leaving or 1 line entering and x>1 lines
leaving. These denote join/fork, respectively.
A deployment diagram in the Unified Modeling Language models the physical deployment of artifacts on
nodes. To describe a web site, for example, a deployment diagram would show what hardware
components ("nodes") exist (e.g., a web server, an application server, and a database server), what
software components ("artifacts") run on each node (e.g., web application, database), and how the
different pieces are connected (e.g. JDBC, REST, RMI).The nodes appear as boxes, and the artifacts
allocated to each node appear as rectangles within the boxes. Nodes may have sub nodes, which appear as
nested boxes. A single node in a deployment diagram may conceptually represent multiple physical nodes,
such as a cluster of database servers.
Execution Environment Node Device nodes are physical computing resources with processing memory and
services to execute software, such as typical computers or mobile phones. An execution environment node
(EEN) is a software computing resource that runs within an outer node and which itself provides a service
to host and execute other executable software elements.
SIGNIFICANCE:
These are the important for the design of any project done by the software designer
APPLICATION AREA:
Used in all IT companies for Designing
DESIGN PATTERNS
One way to describe object design Afte ide tif i g ou e ui e e ts a d eati g a do ai odel, the
add methods to the software classes, and define the messaging between the objects to fulfill the
e ui e e ts .