0% found this document useful (0 votes)
4 views75 pages

Module 3 Part2

The document provides an overview of Object Oriented Analysis (OOA) and Object Oriented Design (OOD), highlighting their principles and processes in software engineering. It also introduces Unified Modeling Language (UML), its goals, characteristics, and various types of diagrams such as use case, class, activity, and state diagrams, which are essential for modeling software systems. Additionally, it explains key concepts like associations, dependencies, generalization, and events within the context of UML.

Uploaded by

gayatripallan02
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views75 pages

Module 3 Part2

The document provides an overview of Object Oriented Analysis (OOA) and Object Oriented Design (OOD), highlighting their principles and processes in software engineering. It also introduces Unified Modeling Language (UML), its goals, characteristics, and various types of diagrams such as use case, class, activity, and state diagrams, which are essential for modeling software systems. Additionally, it explains key concepts like associations, dependencies, generalization, and events within the context of UML.

Uploaded by

gayatripallan02
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Object Oriented Analysis and Design

Object Oriented Analysis (OOA) :-


Object Oriented Analysis (OOA) is the first technical activity performed as part of
object oriented software engineering.

OOA introduces new concepts to investigate a problem.

It is based in a set of basic principles, which are as follows-


• The information domain is modeled.
• Behavior is represented.
• Function is described.
• Data, functional, and behavioral models are divided to uncover greater detail.
• Early models represent the essence of the problem, while later ones provide
implementation details.
Object Oriented Design (OOD):
An analysis model created using object oriented analysis is transformed by object
oriented design into a design model that works as a plan for software creation.

OOD results in a design having several different levels of modularity i.e., The major
system components are partitioned into subsystems (a system level “modular”), and
data their manipulation operations are encapsulated into objects (a modular form that is
the building block of an OO system.).

In addition, OOD must specify some data organization of attributes and a


procedural description of each operation.

Shows a design pyramid for object oriented systems.

It is having the following four layers.


UML Overview
UML is a standard language for specifying, visualizing, constructing, and documenting
the artifacts of software systems.
UML wascreated by the Object Management Group (OMG) and UML 1.0
specification draft was proposed to the OMG in January 1997.
UML stands for Unified Modeling Language.
UML is different from the other common programming languages such as C++, Java,
COBOL, etc.
UML is a pictorial language used to make software blueprints.
UML can be described as a general purpose visual modeling language to visualize,
specify, construct, and document software system.
UML is not a programming language but tools can be used to generate code in various
languages using UML diagrams.
Goals of UML :-
• UML came into existence after the introduction of object-oriented concepts to
systemize and consolidate the object-oriented development, due to the absence of
standard methods at that time.
• The UML diagrams are made for business users, developers, ordinary people, or
anyone who is looking forward to understand the system, such that the system can be
software or non-software.
• Thus it can be concluded that the UML is a simple modeling approach that is used to
model all the practical systems.
Characteristics of UML :-
The UML has the following features:
• It is a generalized modeling language.
• It is distinct from other programming languages like C++, Python, etc.
• It is interrelated to object-oriented analysis and design.
• It is used to visualize the workflow of the system.
• It is a pictorial language, used to generate powerful modeling artifacts.
UML Diagrams
Use Case Diagram:
• A use case diagram is used to represent the dynamic behavior of a system.
• It encapsulates the system's functionality by incorporating use cases, actors, and
their relationships.
• It models the tasks, services, and functions required by a system/subsystem of an
application.
• It depicts the high-level functionality of a system and also tells how the user handles
a system.
Purpose of Use Case Diagrams :
• The main purpose of a use case diagram is to portray the dynamic aspect of a system.
• It accumulates the system's requirement, which includes both internal as well as
external influences.
• It invokes persons, use cases, and several things that invoke the actors and
elements accountable for the implementation of use case diagrams.
• It represents how an entity from the external environment can interact with a part of
the system.
Following are the purposes of a use case diagram given below:
• It gathers the system's needs.
• It depicts the external view of the system.
• It recognizes the internal as well as external factors that influence the system.
Class Diagram:
Relationship among classes

ASSOCIATION:
An association is a structural relationship that specifies that objects of
one thing are connected to objects of another.

Graphically, an association is rendered as a solid line


connecting the different classes.
Binary Association
An association that connects exactly two classes is called a binary association.
ROLE:
When a class participates in an association it has a specific
role that it plays in that relationship.
For e.g. class Person playing the role of employee is
associated with the class Company who is playing the role of
employer.
Reflexive association
An association relation can be reflexive meaning that the start and the
end of the line representing the association point to the same class

An instance of Employee can be the manager of another Employee


instance. However because the relationship role of “manages’ has a
multiplicity of 0..* an Employee might not have any other Employee to
manage.
QualifiedAssociation
We find that object can be identified by unique value (also known as key) e.g. a car
can be identified by its plate no.
The qualified association i.e. key is specified in a box attached to a class. For e.g.1)
library object will use callNum to uniquely identify a particular book object.
Multiplicity:
How many objects of one class can be linked to an object of another class. It defines the
quantity in an association.
Dependencies
A dependency is a relationship that states that one thing uses the information and
services of another thing but not necessarily the reverse.
Is used to show that some element or set of elements depends on other model
elements.
Graphically, a dependency is rendered as a dashed directed line, directed to the thing
being depended on.
Dependency

figure shows a dependency from CourseSchedule to Course, because Course is


used in both the add and remove operations of CourseSchedule.
Generalization
A generalization is a relationship between a general thing (called the superclass
or parent)and a more specific kind of that thing (called the subclass or child).

Generalization is sometimes called an "is-a-kind-of" relationship.

generalization is rendered as a solid directed line with a large close arrowhead


pointing to the parent.
Generalization:
Inheritance
Inheritance means one class of object takes on characteristics
of another class and extends them.
Aggregation
It is weak form of association.
Aggregation is a binary association representing whole/part relationship.
It is used to distinguish a “whole” from a “part”.
Simple aggregation is entirely conceptual and does nothing more than
distinguish a "whole" from a "part."
The lifetime of the part is not managed by the whole.
Composition
It is strong form of association.
In composite aggregation, the whole is responsible for the disposition of its parts,
which means that the composite must manage the creation and destruction of its
parts.
The lifetime of the part is managed by the whole.
Representation of Class
Example of Class Diagram
Object diagram
An object diagram is a diagram that shows a set of objects and their relationships.
Graphically, an object diagram is a collection of vertices and arcs.
A particular static configuration of a system at one instant is called a snapshot.
A diagram of a snapshot is an image of a system at a point in time. Because it
contains images of objects, it is called an object diagram.
An object diagram is an instance of a class diagram. It implies that an object
diagram consists of instances of things used in a class diagram.
Object diagrams commonly contain Objects and Links object diagrams may
contain notes and constraints.
Object diagrams are used to model the static design view.
The static view describes the possible instances that can occur.
The static view defines the set of objects, values, and links that can exist in a single
snapshot.
Object diagrams can be imagined as the snapshot of a running system at a particular
moment.
Object diagram
How to draw Object Diagram?
To capture a particular system, numbers of class diagrams are limited. if we
consider object diagrams then we can have unlimited number of instances
which are unique in nature. So only those instances are considered which are
having impact on the system.
• First, analyze the system and decide which instances are having important
data and association.
• Second, consider only those instances which will cover the functionality.
Before drawing an object diagrams the following things should be
remembered.
• Object diagrams are consist of objects.
• The link in object diagram is used to connect objects.
• Objects and links are the two elements used to construct an object diagram.
purpose of the object diagram can be summarized as :

1. Object relationships of a system


2. Static view of an interaction
3. Understand object behavior and their relationship from practical perspective
Links
A link is a semantic connection among objects.
A link specifies a path along which one object can dispatch a message to another.
As an instance of an association, a link may be rendered with most of the
adornments appropriate to associations, such as a name, association role name,
navigation, and aggregation.
Multiplicity does not apply to links, since they are instances of an association.
Links and association
Activity Diagram :

● An activity diagram shows a flow of work through a series of action.


● They are used to clarify complicated use cases.
● Arrows run from the start towards the end and represent the order in
which activities happen.
● They can be regarded as form of flowchart.
Elements in activity diagrams

1) Initial state :
An initial state is a model element that explicitly shows the beginning of
a workflow on an activity diagram.

It is the point at which reading of the activity diagram begins.

An activity diagram contains a single start node.

The initial state is drawn as a solid circle with an optional name or label
2) Action :
An Action is a model element that represents the performance of a task in a
workflow.
Each action must occur before the workflow continues to the next element on
an activity diagram.
Action may be nested - i.e. action may have sub-actions.
Action is drawn as a capsule shaped rounded rectangle with a name or
description.
3) Decision point :
A Decision is a model element that typically has one incoming transition and two
or more outgoing transitions based upon the outcome of guard conditions from the
previous element.
Decision is drawn as a diamond shape usually without a name or label (no need for
name/label because the guard conditions usually imply the reason for the decision)
4) Transition :

Transition element connects the various elements of the activity diagram.


The transition element represents the workflow between two or more actions or
other elements of the activity diagram.
It is drawn as a solid line with open arrowhead.
Transition element can have an optional label enclosed in square brackets
called guard condition
a) Fork
A fork identifies where a single flow of control divides into two or more separate,
but simultaneous flows.
The fork represent that the flow through the diagram has splits
into two paths that are running in parallel(multitasking).
Fork is drawn as a bar with one transition going into it and two or more
transitions leaving it.
b) Join
A join identifies where two or more simultaneous flows of control unite into a single
flow of control.
For every fork there should be a join.
The join simply shows that when the parallel activities has
finished and then come back to join a single flow again.
The join has several control flows entering and single control flow on exit.
There is no need to label fork or join.
Join is drawn as a bar with two or more transitions going into it and one transition leaving it
.
C) Merge
Merge node is a control node that brings together multiple
incoming alternate flows to accept single outgoing flow.
The notation for a merge node is a diamond-shaped symbol
with two or more edges entering it and a single activity edge
leaving it.
5) Final state
A final state is a model element that explicitly shows
the end of a workflow on an activity diagram.
Unlike initial state, there can be multiple final states in an
activity diagram to indicate termination of specific
branches of workflow.
Final state is drawn as a filled circle inside a larger unfilled
circle with an optional name or label.
Guidelines for creating activity diagram

Every activity diagram should have exactly one start state.


Every activity diagram should contain one or more end states.
It is not necessary to label a merge , fork or join.
For every fork synchronization bar there should be corresponding join synchronization bar.
Before a merge can happen all inputs must first complete.
Activity Decomposition
Examples of Activity Diagram
Partition - swim lane
An activity partition is activity group for actions that have some common characteristic.
Activity partition may be shown using a swim lane.
Swim lane is a rectangular area on an activity diagram representing the activities
done by a single agent.
Swim lanes depict who or what is responsible for carrying out specific activities.
Swim lane enables grouping of actions on the activity diagram performed by
same actor.
Swim lanes are drawn as vertical columns or horizontal rows with a name associated
with each swim lane.
State Diagram :
State diagram is a graph whose nodes are states and whose directed arcs are
transitions between states.
A state diagram specifies the state sequence caused by event sequences.
State names must be unique within the scope of a state diagram.
STATE :
A state is a condition or situation during the life of an object during which it
satisfies some condition, performs some activity, or waits for some event.
For example, a Heater in a home might be in any of four states: Idle (waiting
for a command to start heating the house), Activating (its gas is on, but it's
waiting to come up to temperature), Active (its gas and blower are both on),
and Shutting Down (its gas is off but its blower is on, flushing residual heat
from the system).
Notation used in State chart diagram
1. States : States represent situations during the life of an object. It is rendered
using rectangle with rounded corner

2 .Transition : A solid arrow represents the path between different states of an object.
Label the transition with the event that triggered it and the action that results from
it.
3 . Initial State : A filled circle followed by an arrow represents the object's initial
state.

4 . Final State : An arrow pointing to a fill circle represents the object's final state.

nested inside another

5. Synchronization and Splitting of Control :A short heavy bar with two transitions
entering it represents a synchronization of control. A short heavy bar with two
transitions leaving it represents a splitting of control that creates multiple states.
a set of states is connected by transitions.
A state is shown as a rectangle with rounded corners .

Initial and Final States :


Initial state which indicates the default starting place for the state machine or substate.
An initial state is represented as a filled black circle.
Final state which indicates that the execution of the state machine or the enclosing
state has been completed.
A final state is represented as a filled black circle surrounded
by an unfilled circle.
Figure : States
As the figure shows, there are two special states that may be defined for an
object's state machine. First, there's the initial state, which indicates the default
starting place for the state machine or substate. An initial state is represented as
a filled black circle. Second, there's the final state, which indicates that the
execution of the state machine or the enclosing state has been completed. A
final state is represented as a filled black circle surrounded by an unfilled circle
Guard Condition
A guard condition is the boolean expression that must be true in order for a transition to occur.
The guard condition is evaluated when a trigger event occurs.
If the expression evaluates as true, then the transitions fires—that is, its effects occur. If the expression
evaluates as false, then the transition does not fire.
guard condition is evaluated only once, at the time the trigger event occurs. If the condition is false and
later becomes true, it is too late to fire the transition.
The same event can be a trigger for more than one transition leaving a single state. Each transition with the
same event must have a different guard condition.
Event Vs State
Events represent point in time; states represent interval of time.
A state corresponds to the interval between two events received by an object.
Change Event
A change event is an event that is caused by the satisfaction of a Boolean
expression.
This is declarative way to wait until a condition is satisfied .
This is both good and bad.
➢ It is good because it focuses the model on the true dependency—an effect that
occurs when a given condition is satisfied—rather than on the mechanics of
testing the condition. It is bad because it complicates the cause-and-effect
relationship between the action that changes underlying value and eventual
effects.
The uml notation for a change event is the keyword when
followed by a parenthesized Boolean expression.
Ex. i) when (battery power < lower limit )
ii) when ( tire pressure < minimum pressure)
Time Event
Time events represent the passage of time.
A time event can be specified either in absolute mode (time of day) or relative
mode (elapse of time interval).
The uml notation for absolute time is the keyword when followed by a
parenthesized expression involving time.
The uml notation for a time interval is the keyword after followed by a
parenthesized expression that evaluates to time duration.
Ex. i) When (date = march 1 , 2012 )
ii) after (10 seconds)
Figure : Time and Change Event

Figure shows, a change event by using the keyword when followed by some Boolean
expression. We can use such expressions to mark an absolute time (such as when
time = 11:49).
Figure shows, a time event by using the keyword after followed by some
expression that evaluates to a period of time (such as after 2 seconds)
Trigger Event

The trigger is an event the occurrence of which enables the transition.


The events may have parameters, which are available to an action on the
transition.
State diagram states
Composite State :
A substate is a state that is nested in another state. A state that has substates is called a composite state

Composite state is state that consists of either concurrent substates or sequential substates.
concurrent substate : An orthogonal substate that can be held simultaneously with other substates
contained in the same composite state.
Sequential substate : A substate that cannot be held simultaneously with other substates contained in the
same composite state.
Substates could be sequential (disjoint) or concurrent (orthogonal).
If a transition is to a composite state, the nested state machine must have an initial state.
Figure :Sequential Substates for ATM system
Do activity
A do-activity is an activity that continues for an extended time.
A do-activity can only occur within a state and cannot be attached to a transition.
The notation “do / “ denotes a do-activity that may be performed for all or part
of the duration that an object is in a state.
For example , the warning light may flash during the paper jam state for a copy
machine.
Do-activities include continuous operations such as displaying a picture on a television
screen as well as sequential operations that terminate by themselves after an interval
of time such as closing a valve.
Sequence diagram:

A sequence diagram shows the participants in an interaction and the sequence of


messages among them.

Shows the objects participating in the interaction by their lifelines and the
messages they exchange, arranged in time sequence.

A sequence diagram does not show the links among the objects.

A sequence diagram can exist in a generic form (describing all possible sequences)
and in an instance form (describing one execution sequence consistent with the
generic form).
● A sequence diagram displays an interaction as a two-dimensional chart.
● The vertical dimension is the time axis; time proceeds down the page.
● The horizontal dimension shows the classifier roles that represent individual
objects in the collaboration.
● Each classifier role is represented by a vertical column—the lifeline.
● During the time an object exists, the role is shown by a dashed line.
● During the time an activation of a procedure on the object is active, the lifeline
is drawn as a double line.
● A message is shown as an arrow from the lifeline of one object to that of
another. The arrows are arranged in time sequence down the diagram.
● An active object is one that holds the root of a stack of activations.
Notations used in Sequence diagram :
Actor An Actor models a
type of role played by
an entity that
interacts with the
system but which is
external to the system.
Call Message Call message is a
kind of message that
represents an
request of operation
of target lifeline.
Constraint Constraint is
condition or
restriction expressed
in natural language
text or in a machine
readable language
for the purpose of
declaring some of the
semantics of an
element.
Destroy Message Destroy message is a
kind of message that
represents the request of
destroying the lifecycle
of target lifeline.

Frame A frame represents an


interaction, which is a
unit of behavior that
focuses on the
observable exchange of
information between
Connectable Elements.

Interaction Use An Interaction Use


refers to an Interaction.
The Interaction Use is a
short hand for copying
the contents of the
referred Interaction
where the Interaction
Use is.
LifeLine A lifeline represents an
individual participant in
the Interaction.

Recursive Message Recursive message is a


kind of message that
represents the request
of message of the same
lifeline.

Reentrant Message A reentrant message


points to an activation on
top of another activation.
Synchronous message Synchronous message
typically represents operation
call - send message and
suspend execution while waiting
for response. Synchronous call
messages are shown with filled
arrow head.

Asynchronous message Asynchronous message- send


message and proceed
immediately without waiting for
return value. Asynchronous
messages have an open arrow
head.
Figure : sequence diagram for ATM transaction
Hardware Architecture
Deployment Diagram:
A uml deployment diagram defines the hardware architecture of a system or
application.
Deployment diagram show the hardware for your system, the software that is installed
on that hardware and the middleware used to connect the different machines to one
another.
Deployment diagrams show the relationships between the software and hardware
components in the system and the physical distribution of the processing.
Deployment diagrams are typically prepare during the implementation phase of
development.
The diagram includes a set of nodes depicted as three dimensional cubes.
Nodes represent hardware devices such as computers, sensors, and printers, as well as
other devices that support the runtime environment of a system.
Deployment diagrams are effective for visualizing, specifying, and documenting the
following types of systems:
Embedded systems that uses hardware that is controlled by external stimuli; for
example, a display that is controlled by temperature change.
Distributed systems that have multiple servers and can host multiple versions of
software artifacts, some of which might even migrate from node to node
Deployment diagrams show the physical arrangement of the nodes in a distributed
system, the artifacts that are stored on each node, and the components and other
elements that the artifacts implement.
The relation between nodes represent physical connections between the
corresponding processors.
Node :
A node is a physical element that exists at run time and represents a computational
resource, generally having at least some memory and, often, processing capability.
Nodes are model elements that represent the computational resources of a system,
such as personal computers, sensors, printing devices or servers. Nodes can be
interconnected, by using communication paths to describe network structures.
A set of components may reside on a node and may also migrate from node to node.
Graphically, a node is rendered as a cube usually including its name
Simple and Extended Nodes
The name alone is known as a simple name.
A path name is the node name prefixed by the name of the package in which that node
lives.
A node is typically drawn showing only its name, as shown in Figure. Just as with classes,
you may draw nodes adorned with tagged values or with additional compartments to
expose their details.
Artifacts :
An artifact is physical and replaceable part of a system.
Artifacts are model elements that represent the physical entities in a software system.
Artifacts represent physical implementation units such as executable
files, libraries, software components, documents, and databases.
Graphically an artifact is rendered as a rectangle with keyword
<<artifact>>
Every artifact must have a name that distinguish it from other artifacts. A
name is a textual string.
The name alone is known as a simple name; a qualified name is the artifact name prefixed by the
name of the package in which that artifact life
Device : In deployment diagrams, a device is a type of node that represents a
physical computational resource in a system, such as an application server.
Execution environment : In UML modeling, an execution environment is a
type of node that represents a particular execution platform, such as an
operating system or a database management system.
Note : descriptive part of the system
Example of deployment diagram

A node is shown as a cube with the name of the node and, optionally, its classification .
Associations between nodes represent communication paths.

The presence of an object on a node is shown by physically nesting the object symbol inside the node
symbol. If that is not convenient, the object symbol may contain the tag location whose value is the
name of the node on which the object resides (its location).

You might also like