You are on page 1of 98

MASTER OF COMPUTER APPLICATION

UNIT III
Use-case Driven Object oriented Analysis

✓ Introduction to oops concepts ✓ Inheritance, Sub Types and IS-A


✓ Class and object hierarchy
✓ Abstraction and encapsulation ✓ Behavioral Diagram
✓ Method and messages ✓ Use case Diagram
✓ Interface, Inheritance and polymorphism✓ Identify Actors
✓ Structural Diagram - Class Diagram and ✓ Identify Use cases: describing
Object diagram how the user will use the system
✓ Associations and links Aggregation , ✓ Develop use-case Model
Composition and containment ✓ Use case Diagram.
✓ Activity Diagram ✓ Sequence diagram
1 MASTER OF COMPUTER APPLICATION
Unit Objective

I. To learn the fundamentals of OOPS concept


II. To understand the basic concept of OOAD
III. To learn the different diagrams of UML.

Unit Outcomes

i. To study the basic structure and principles of OOAD


ii. To understand & implement the OOPS concept in system
development.
iii. To understand and design the different UML diagrams.

2 MASTER OF COMPUTER APPLICATION


Introduction to UML
❑What is UML?
❑The UML stands for Unified modeling language.
❑UML is a standardized general-purpose visual modeling
language in the field of Software Engineering.
❑ It is used for specifying, visualizing, constructing, and
documenting the primary artifacts of the software system.
❑UML helps in designing and characterizing software systems
that incorporate the concept of Object orientation.
❑ It describes the working of the software and hardware systems.
❑The UML diagrams are made for business users, developers,
ordinary people who is looking forward to understand the system.

3 MASTER OF COMPUTER APPLICATION


Introduction to UML
❑What are Characteristics of UML?
❑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.

4 MASTER OF COMPUTER APPLICATION


Introduction to oops concepts
❑What is object-oriented analysis ?
❑Object-oriented analysis is a method of analysis that examines
requirements from the perspective of the classes and objects
found in the terminology of the problem domain.
❑The main tasks in object-oriented analysis (OOA) are −
❑Identifying objects
❑Organizing the objects by creating object model diagram.
❑Defining the internals of the objects, or object attributes
❑Defining the behavior of the objects, i.e., object actions
❑Describing how the objects interact

5 MASTER OF COMPUTER APPLICATION


Object Oriented Systems Development Activities
❑What is Object Oriented Systems Development Life Cycle?
❑It consists of three macro processes −
✓ Object Oriented Analysis (OOA)
✓ Object oriented design (OOD)
✓ Object oriented Implementation (OOI)
❑Object Oriented Analysis (OOA)
❑This phase concerns with determining the system requirements.
❑It is also used understand the system requirements.
❑It is use a use-case model to understand the system requirements.
❑A use-case is a scenario to describe the interaction between user
and computer system.
❑This model represents the user needs or user view of system.

6 MASTER OF COMPUTER APPLICATION


Object Oriented Systems Development Activities
❑What is Object Oriented Systems Development Life Cycle?
❑Object-Oriented Design:
❑The objective of this phase is to design and refine the classes,
attributes, methods, and structures that are identified during the
analysis phase, user interface, and data access.
❑ This phase also identifies and defines the additional classes or
objects that support implementation of the requirement.

7 MASTER OF COMPUTER APPLICATION


Conceptual Modeling
✓ A conceptual model is composed of several interrelated concepts.
✓ Object: An object is a real world entity.
✓ It is a fundamental building block of UML.
✓ Class: A class is a software blueprint for objects, it defines the
variables and methods common to all the objects of a particular type.
✓ Abstraction: Abstraction is the process of representing the
essential characteristics of an object to the users while hiding the
irrelevant information.
✓ Inheritance: Inheritance is the process of deriving a new class from
the existing ones.
✓ Polymorphism: It is a mechanism of representing objects having
multiple forms used for different purposes.
✓ Encapsulation: It binds the data and the object together as a single
unit, enabling tight coupling between them.

8 MASTER OF COMPUTER APPLICATION
Object-Oriented Analysis & Design (OOAD)
❑What is OOAD?
❑It identifies the objects in problem domain, classifying them in
terms of data and behavior.
❑OOAD approach is focus on capturing the structure and
behavior of information systems into small modules that
combines both data and process.
❑The main aim of Object Oriented Design (OOD) is to improve the
quality and productivity of system analysis and design by
making it more usable.
❑ The main aim of Object Oriented Design (OOD) is to improve the
quality and productivity of system analysis and design by
making it more usable.
❑OO models are used to fill the gap between problem and
solution.
9 MASTER OF COMPUTER APPLICATION
Object-Oriented Analysis & Design (OOAD)
❑Elements of Object-Oriented System
❑Objects :
❑ An object is entity that is exists within problem domain and can be
identified by data (attribute) or behavior.
❑All tangible entities like student, patient & intangible - bank account.
❑Attributes:
❑They describe information about the object.
❑Behavior :
❑It specifies what the object can do.
❑ It defines the operation performed on objects.
❑Class : A class encapsulates the data and
its behavior.
❑Methods :
❑Methods determine the behavior of a class.
❑They are nothing more than an action that an object can perform.
1 MASTER OF COMPUTER APPLICATION
0
Object-Oriented Analysis & Design (OOAD)
❑Elements of Object-Oriented System
❑Message:
❑ A message is a function or procedure call from one object to
another.
❑They are information sent to objects to trigger methods.

1 MASTER OF COMPUTER APPLICATION


1
Features of Object-Oriented System
❑What are features of Object-Oriented System?
➢ An object-oriented system comes with several great features which
are such as…….
➢ Encapsulation:
➢ Encapsulation is a process of information hiding.
➢ It is simply the combination of process and data into a single
entity.
➢ Data of an object is hidden from the rest of the system and
available only through the services of the class.
❑Abstraction:
❑It is a process of taking or selecting necessary method and
attributes to specify the object.
❑It focuses on essential characteristics of an object relative to
perspective of user.
1 MASTER OF COMPUTER APPLICATION
2
Features of Object-Oriented System
➢ Relationships:
➢ All the classes in the system are related with each other.
➢ The objects do not exist in isolation, they exist in relationship with
other objects.
➢ There are three types of object relationships…..
➢ Aggregation:
➢ It indicates relationship between a whole and its parts.
➢ Association:
➢ Two classes are related or connected in such way that one class works
with another to perform a task
➢ one class acts upon other class.

1 MASTER OF COMPUTER APPLICATION


3
Features of Object-Oriented System
➢ Generalization :
➢ The child class is based on parent class.
➢ It indicates that two classes are similar but have some differences.
➢ Encapsulation and Data Hiding:
➢ Encapsulation:
➢ Encapsulation is the process of binding both attributes and methods
together within a class.
➢ Encapsulation, the internal details of a class can be hidden from
outside.
➢ Data Hiding:
➢ This process of insulating an object’s data is called data hiding or
information hiding.
➢ Inheritance:
➢ Inheritance is the mechanism that permits new classes to be created
out of existing classes by extending and refining its capabilities.
1 MASTER OF COMPUTER APPLICATION
4
Unified Modeling Language(UML)
Building Block of UML:
Grouping Things:
Grouping things can be defined as a mechanism to group elements
of a UML model together.
There is only one grouping thing available −

Package :
Package is the only one grouping thing available for gathering
structural and behavioral things.

1 MASTER OF COMPUTER APPLICATION


5
Unified Modeling Language(UML)

❑ Relationship:
✓ Association
✓ Association is basically a set of links that connects the elements of
a UML model.
✓ It also describes how many objects are taking part in that
relationship.
✓ There are different types of associations, such as one-to-one, one-
to-many, many-to-one, and many-to-many.
✓ It shows the static relationship between the entities of two classes.
✓ An association categorized into four types such as bi-directional,
unidirectional, aggregation (composition aggregation), and
reflexive.
✓ The mostly used associations are unidirectional and bi-directional.

1 MASTER OF COMPUTER APPLICATION


6
Unified Modeling Language(UML)

✓ Aggregation
✓ An aggregation is a special form of association.
✓ It is also known as Has-a relationship.
✓ In aggregation, a child can exist independent of the parent.
✓ An aggregation relationship can describe as
✓ “an object of one class can own or access the objects of another
class.”
✓ Eg.
✓ A car needs a wheel to function correctly, but a wheel doesn’t
always need a car.
❑ A wheel used for bike, bicycle, or any other vehicles but not a
particular car.

1 MASTER OF COMPUTER APPLICATION


7
Unified Modeling Language(UML)
❑ Relationship:
✓ Generalization
✓ Generalization can be defined as a relationship which connects a
specialized element with a generalized element.
✓ It basically describes the inheritance relationship in the world of
objects.

✓ Realization
✓ Realization can be defined as a relationship in which two
elements are connected.
✓ One element describes some responsibility, which is not
implemented itself but the other one implements them.
✓ This relationship exists in case of interfaces.

18 MASTER OF COMPUTER APPLICATION


Unified Modeling Language(UML)
❑ Annotational Things:
✓ Annotational things can be defined as a mechanism to capture
remarks, descriptions, and comments of UML model elements.
✓ A note is used to render comments, constraints, etc. of an UML
element.

❑ Relationship:
✓ Relationship is another most important building block of UML.
✓ It shows how the elements are associated with each other and this
association describes the functionality of an application.
✓ There are four kinds of relationships available.

1 MASTER OF COMPUTER APPLICATION


9
Unified Modeling Language(UML)
Association Aggregation Composition
Association It is represented by a It is represented by a
relationship is straight line with an straight line with a
represented using an empty diamond at black diamond at one
arrow. one end. end.
It is a part of the It is a part of the
it can exist between
association aggregation
two or more classes.
relationship. relationship.
one-to-one, one-to-
many, many-to-one,
It exhibits a kind of It exhibits a strong
and many-to-many
weak relationship. type of relationship.
association between
the classes.

2 MASTER OF COMPUTER APPLICATION


0
Difference
Association Aggregation Composition
the associated objects
the associated objects exist
It can associate one more cannot exist
independently within the
objects together. independently within the
scope of the system.
scope of the system.
In this, the linked objects
In this, objects are linked Here the linked objects are
are independent of each
together. dependent on each other.
other.
It may or may not affect Deleting one element in
It affects the other element
the other associated the aggregation relationship
if one of its associated
element if one element is does not affect other
element is deleted.
deleted. associated elements.
Example: If a file is placed
Eg: A tutor can associate Example: A car needs a in a folder and that is
with multiple students, or wheel for its proper folder is deleted. The file
one student can associate functioning, but it may not residing inside that folder
with multiple teachers. require the same wheel. will also get deleted at the
time of folder deletion.
2 MASTER OF COMPUTER APPLICATION
1
Unified Modeling Language(UML)

22 MASTER OF COMPUTER APPLICATION


Unified Modeling Language(UML)
❑ UML Diagrams
❑ All the elements, relationships are used to make a complete UML
diagram and the diagram represents a system.
❑ The visual effect of the UML diagram is the most important part of
the entire process.
➢ Class diagram
➢ Object diagram
➢ Use case diagram
➢ Sequence diagram
➢ Collaboration diagram
➢ Activity diagram
➢ Statechart diagram
➢ Deployment diagram
➢ Component diagram

2 MASTER OF COMPUTER APPLICATION


3
Types of UML Diagrams

2 MASTER OF COMPUTER APPLICATION


4
Unified Modeling Language(UML)
❑ UML Diagrams
❑ Any real-world system is used by different users.
❑ The architecture is made with different perspectives in mind.
❑ The most important part is to visualize the system from the
perspective of different viewers.
❑ UML plays an important role in defining different perspectives of
a system.
❑ Design
❑ Implementation
❑ Process
❑ Deployment
❑ A Use Case represents the functionality of the system.

2 MASTER OF COMPUTER APPLICATION


5
Unified Modeling Language(UML)
❑ Design:
❑ Design of a system consists of classes, interfaces, and
collaboration.
❑ UML provides class diagram, object diagram to support this.
❑ Implementation
❑ It defines the components assembled together to make a complete
physical system.
❑ Process :
❑ Process defines the flow of the system.
❑ The same elements are used in Design are also used to support this
perspective(view).
❑ Deployment represents the physical nodes of the system that forms
the hardware.
❑ UML deployment diagram is used to support this perspective.
2 MASTER OF COMPUTER APPLICATION
6
Entity Relational Model(ER)
❑ What is Entity Relational Model(ER)?
❑ The ER model is a high-level data model diagram
❑ ER diagrams are a visual tool which is helpful to represent the ER
model
❑ ER is widely used in Database Design
❑ It is a GUI representation of the logical structure of a Database.
❑ It helps to identifies the entities which exist in a system and the
relationships between those entities.
❑ ER modelling helps you to analyse data requirements
systematically to produce a well-designed database.

2 MASTER OF COMPUTER APPLICATION


7
ER Diagram
❑ Why use ER Diagrams?
❑ It helps you to define terms related to entity relationship
modeling
❑ Helps to describe entities, attributes, relationships.
❑ ER diagrams are changeable into relational tables which
allows you to build databases quickly
❑ ER diagrams can be used by database designers as a blueprint
for implementing data in specific software applications
❑ The database designer gains a better understanding of the
information to be contained in the database with the help of
ER diagram
❑ ERD is allowed you to communicate with the logical structure
of the database to users

2 MASTER OF COMPUTER APPLICATION


8
ER Diagram

❑ Components of the ER Diagram


✓ Entities
✓ Attributes
✓ Relationships
❑ WHAT IS ENTITY?
✓ A real-world thing either living or non-living ➢ Examples of entities:
that is easily recognizable and non ➢ Person: Employee,
Student, Patient
recognizable. ➢ Place: Store, Building
✓ An entity can be place, person, object, event or➢ Object: Machine,
a concept, which stores data in the database. product, and Car
➢ Event: Sale,
❑ Weak Entity Registration, Renewal
❑ A weak entity is an entity that depends on the ➢ Concept: Account,
existence of another entity. Course

2 MASTER OF COMPUTER APPLICATION


9
ER Diagram

3 MASTER OF COMPUTER APPLICATION


0
ER Diagram

31 MASTER OF COMPUTER APPLICATION


ER Diagram

32 MASTER OF COMPUTER APPLICATION


ER Diagram
Entity:

Attribute
Multivalued Attribute

Key Attribute
Composite Attribute
Derived Attribute

3 MASTER OF COMPUTER APPLICATION


3
ER Relations
Relationship:

One-to-One Relationship

One-to-many relationship

Many-to-one relationship

Many-to-many relationship

3 MASTER OF COMPUTER APPLICATION


4
Notation of ER diagram

3 MASTER OF COMPUTER APPLICATION


5
Use Case Diagram
❑ What is Use Case Diagram?
❑ A use case is a useful technique for identifying, clarifying, and
organizing system requirements.
❑ A use case is made up of a set of possible sequences of interactions
between systems and users.
❑ A use case describes how a user uses a system to accomplish a
particular goal.
❑ The purpose of use case diagram is to capture the dynamic aspect
of a system.
❑ Use case diagrams are used to gather the requirements of a
system including internal and external influences.
❑ Use case diagrams are drawn to capture the functional
requirements of a system.

36 MASTER OF COMPUTER APPLICATION


Use Case Diagram
❑ What is purpose of Use Case Diagram?
❑ The purposes of use case diagrams can be said to be as follows −
❑ Used to gather the requirements of a system.
❑ Used to get an outside view of a system.
❑ Identify the external and internal factors influencing the system.
❑ Show the interaction among the requirements are actors.
❑ Requirement analysis and high level design.
❑ Model the context of a system.
❑ Reverse engineering.
❑ Forward engineering.

37 MASTER OF COMPUTER APPLICATION


Use Case Diagram
❑ Use Case Diagram Notations
❑ Use cases define interactions between external actors and the
system to attain particular goals.
❑ A use case diagram contains four main components
❑ Actor
❑ Use Case
❑ Relationship
❑ System Boundary
❑ Actor :
❑ Actors are individuals involved with the system defined according
to their roles.
❑ The actor is the entity that interacts with the subject.
❑ An actor is behaviour classifier which specifies a role played by
an external entity .

38 MASTER OF COMPUTER APPLICATION


SINHGAD INSTITUTE OF TECHNOLOGY, LONAVALA
Use Case Diagram
❑ Generalization between actors is rendered as a solid
directed line with a large arrowhead.
❑Use Case:
❑ A use case describes how actors uses a system to
achieve a particular goal.
❑ It represents a functional unit of a large
application.
❑ It is located inside the System boundary rectangle.
❑System boundary:
❑ A system boundary defines the scope of what a
system will be.
❑ A system boundary of a use case diagram defines
the limits of the system.

39 MASTER OF COMPUTER APPLICATION


Use Case Diagram
❑ Relationship:
❑ The relationships between the actors and the use cases.
❑ An association between an actor and a use case indicates that the
actor
❑ The use case shows interact or communicate with each other.
❑ Include: <<include>>
❑ Include relationship between the including (base) use case to the
included (common part) use case.
❑ The arrow is labelled with the keyword «include».
❑ Binary associations are allowed between actors and use cases.
❑ The include relationship could be used:
❑ To simplify large use case by splitting it into several use cases,
❑ To extract common parts of the behaviours of two or more use cases.

40 MASTER OF COMPUTER APPLICATION


Use Case Diagram
❑ Extend <<extend>> :
❑ When one action is an extension of
another action.
❑ <<extend>> is a directed relationship
that specifies how and when the behavior
defined is usually supplementary
(optional).
❑ Getting help on registration is an
optional thing while you are registering
hence <<extend>> is used.
❑ System Boundary
❑ The system boundary defines the system
of interest in relation to the world
around it.

41 MASTER OF COMPUTER APPLICATION


Use Case Diagram

42 MASTER OF COMPUTER APPLICATION


Use Case Diagram

43 MASTER OF COMPUTER APPLICATION


Use Case Diagram

44 MASTER OF COMPUTER APPLICATION


Use Case Diagram

45 MASTER OF COMPUTER APPLICATION


Class Diagram
❑ What is Class Diagram?
❑ Class Diagram gives the static view of an application.
❑ A class diagram describes the types of objects in the system and
the different types of relationships that exist among them.
❑ Class Diagram gives an overview of a software system by
displaying classes, attributes, operations, and their relationships.
❑ This Diagram includes the class name, attributes, and operation in
separate designated compartments.
❑ Class Diagram helps construct the code for the software
application development.

4 MASTER OF COMPUTER APPLICATION


6
Class Diagram
❑ What are Benefits of Class Diagram?
❑ Class diagram is a static diagram.
❑ It represents the static view of an application
❑ Class diagram is not only used for visualizing, describing, and
documenting different aspects of a system but also for constructing
executable code of the software application.
❑ It is used in the modelling of object oriented systems
❑ It is directly mapped with object-oriented languages
❑ Class diagram shows a collection of classes, interfaces,
associations, collaborations, and constraints.

4 MASTER OF COMPUTER APPLICATION


7
Class Diagram
Visibility of Class Members :

Relationships :

4 MASTER OF COMPUTER APPLICATION


8
Class Diagram
❑ Association:
❑Association is a relationship between two separate classes.
❑Association can be represented by a line between these classes
with an arrow indicating the navigation direction.
❑It joins two entirely separate entities.
❑There are four different types of association…..
❑bi-directional, uni-directional, aggregation, reflexive
❑This can be specified using multiplicity (one to one, one to many,
many to many, etc.).
every Instructor has one or more
A single student can associate with Students:
multiple teachers:

49 MASTER OF COMPUTER APPLICATION


Class Diagram
❑ Inheritance:
❑Inheritance indicates that child (subclass) is
considered to be a specialized form of the
parent (super class). For example consider
the following:
❑ Realization/Implementation:
✓ Realization is a relationship between
two model elements, in which one model
element implements/executes the
behavior that the other model element
specifies.
✓ A class implements an interface.

5 MASTER OF COMPUTER APPLICATION


0
Class Diagram
❑ Inheritance:

5 MASTER OF COMPUTER APPLICATION


1
Class Diagram
❑ Dependency :
❑ A dependency means the relation between two or more classes
in which a change in one may force changes in the other.
❑ Dependency will always create a weaker relationship.
❑ Dependency indicates that one class depends on another.
❑ Generalization:
✓ Generalization can be defined as a relationship which connects a
specialized element with a generalized element.
✓ It basically describes the inheritance relationship in the world of objects.
✓ A generalization helps to connect a subclass to its superclass.
✓ A sub-class is inherited from its superclass.

52 MASTER OF COMPUTER APPLICATION


Class Diagram
❑ Dependency :

❑ Generalization:

53 MASTER OF COMPUTER APPLICATION


Class Diagram

54 MASTER OF COMPUTER APPLICATION


Class Diagram
❑ Composition :
❑ The composition is a special type of aggregation which denotes
strong ownership between two classes when one class is a part of
another class.
❑ Composition display relationship where the child will never
exist independent of the parent.

55 MASTER OF COMPUTER APPLICATION


Class Diagram
❑ Multiplicity :
❑ After specifying the type of association relationship by
connecting the classes, you can also declare the cardinality
between the associated entities. For example:

An UML diagram shows that


a house has exactly one
kitchen, exactly one bath,
atleast one bedroom (can
have many), exactly one
mailbox, and at most one
mortgage (zero or one).

56 MASTER OF COMPUTER APPLICATION


Class Diagram

57 MASTER OF COMPUTER APPLICATION


Class Diagram

58 MASTER OF COMPUTER APPLICATION


Object Diagrams
✓ Object diagrams represent an instance of a class diagram.
✓ Object diagrams are derived from class diagrams so object
diagrams are dependent upon class diagrams.
✓ Object diagrams are used to render a set of objects and their
relationships as an instance.
❑Purpose of Object Diagrams
✓ The object diagram is closer to the actual system behavior.
✓ The purpose is to capture the static view of a system at a particular
moment.
✓ The purpose of the object diagram can be summarized as −
✓ Forward and reverse engineering.
✓ Object relationships of a system
✓ Static view of an interaction.
✓ Understand object behaviour and their relationship from practical
perspective
59 MASTER OF COMPUTER APPLICATION
Object Diagrams
Basic Object Diagram Symbols and Notations
Object Every object is actually symbolized like a
rectangle, that offers the name from the
Names: object and its class underlined as well as
divided with a colon.

Object Similar to classes, you are able to list


object attributes inside a separate
Attributes: compartment.

Links: Links tend to be instances associated


with associations.
You can draw a link while using the
lines utilized in class diagrams.

60 MASTER OF COMPUTER APPLICATION


Object Diagrams

61 MASTER OF COMPUTER APPLICATION


Object Diagrams

62 MASTER OF COMPUTER APPLICATION


Activity Diagram
✓ Activity diagrams captures the dynamic behavior of the system.
✓ Activity diagram is used to show message flow from one activity
to another.
✓ Activity is a particular operation of the system.
✓ Activity diagram is sometimes considered as the flowchart.
✓ Purpose of Object Diagrams
✓ Draw the activity flow of a system.
✓ Describe the sequence from one activity to another.
✓ Describe the parallel, branched and concurrent flow of the system.
✓ Activity diagrams are not only used for visualizing the dynamic
nature of a system, but they are also used to construct the executable
system by using forward and reverse engineering techniques.

63 MASTER OF COMPUTER APPLICATION


Activity Diagram
✓ How to Draw an Activity Diagram?
✓ The main element of an activity diagram is the activity itself.
✓ An activity is a function performed by the system.
✓ After identifying the activities, we need to understand how they
are associated with constraints and conditions.
✓ An activity diagram have the following elements such as……
✓ Activities
✓ Association
✓ Conditions
✓ Constraints

64 MASTER OF COMPUTER APPLICATION


Activity Diagram
✓ Where to use Activity Diagrams?
✓ Activity diagram is suitable for modeling the activity flow of the
system.
✓ An application can have multiple systems.
✓ Activity diagram also captures these systems and describes the
flow from one system to another.
✓ Modelling work flow by using activities.
✓ Modelling business requirements.
✓ High level understanding of the system's functionalities.
✓ Investigating business requirements at a later stage.

65 MASTER OF COMPUTER APPLICATION


Activity Diagram
Activity diagrams Notations:
Initial states:
The starting stage before an activity takes
place is described as the initial state.
State or an activity box:
Action or Activity State:
An activity represents execution of an
action on objects or by objects
Decision box:
It is a diamond shape box which
represents a decision with alternate paths.
It represents the flow of control.

66 MASTER OF COMPUTER APPLICATION


Activity Diagram
Activity diagrams notations:
1. Initial State:
The starting state before an activity takes
place is shown using the initial state.

2. Action or Activity State:


An activity represents execution of an
action on objects or by objects.

3. Action Flow or Control flows:


Action flows or Control flows are also
referred to as paths and edges.

67 MASTER OF COMPUTER APPLICATION


Activity Diagram
Activity diagrams notations:
4. Decision node and Branching:
When we need to make a decision before
deciding the flow of control, we use the
decision node.

5. Fork :
Fork nodes are used to support concurrent
activities.

6. Join :
Join nodes are used to support concurrent
activities converging into one.

68 MASTER OF COMPUTER APPLICATION


Activity Diagram
Activity diagrams notations:
7. Self Message:
A message an object sends to itself, usually shown as a U
shaped arrow pointing back to itself.
8. Create Message
This is a message that creates a new object.
It is similar to a return message.
It is shown with a dashed line and an open arrowhead
that points to the rectangle representing the object created.
9. Delete Message:
This is a message that destroys an object.
It can be shown by an arrow with an x at the end.

69 MASTER OF COMPUTER APPLICATION


Activity Diagram
Activity diagrams notations:
10. Found Message
A message sent from an unknown recipient, shown by an
arrow from an endpoint to a lifeline.
11. Lost Message
A message sent to an unknown recipient.
It's shown by an arrow going from a lifeline to an
endpoint, a filled circle or an x.

70 MASTER OF COMPUTER APPLICATION


Activity Diagram
Activity diagrams notations:
7. Merge or Merge Event :
Scenarios arise when activities which are not being
executed concurrently have to be merged.

8. Swimlanes – We use swimlanes for grouping related


activities in one column.
Swimlanes group related activities into one column or
one row.
9. Final State or End State :
Final states:
The state which the system reaches when a specific
process ends is known as a Final State

71 MASTER OF COMPUTER APPLICATION


Activity Diagram
✓ How to Draw an activity diagram –
✓ Identify the initial state and the final states.
✓ Identify the intermediate activities needed to reach the final
state from the initial state.
✓ Identify the conditions or constraints which cause the
system to change control flow.
✓ Draw the diagram with appropriate notations.

72 MASTER OF COMPUTER APPLICATION


Activity Diagram

73 MASTER OF COMPUTER APPLICATION


Activity Diagram
✓ Following diagram is drawn with the four main activities −
✓ Send order by the customer
✓ Receipt of the order
✓ Confirm the order
✓ Dispatch the order

74 MASTER OF COMPUTER APPLICATION


Activity Diagram

75 MASTER OF COMPUTER APPLICATION


Activity Diagram

76 MASTER OF COMPUTER APPLICATION


Sequence Diagram
✓ What is a Sequence Diagram
✓ A sequence diagram simply shows interaction between objects
in a sequential order i.e. the order in which these interactions
take place.
✓ Sequence diagrams describe how and in what order the objects
in a system function.
✓ These diagrams are widely used by businessmen and software
developers to document and understand requirements for new
and existing systems.
✓ Sequence Diagram Notations –
✓ Actors – An actor in a UML diagram represents a type of role
where it interacts with the system and its objects.

77 MASTER OF COMPUTER APPLICATION


Sequence Diagram
✓ What is a Sequence Diagram
✓ Activation or Execution Occurrence:
Activation boxes represent the time an object needs
to complete a task.

✓ Messages:
Messages are arrows that represent communication
between objects.
✓ Use half-arrowed lines to represent asynchronous
messages.

78 MASTER OF COMPUTER APPLICATION


Sequence Diagram
✓ What is a Sequence Diagram
✓ Synchronous Message
A synchronous message requires a response before the
interaction can continue.
✓ It's usually drawn using a line with a solid arrowhead pointing
from one object to another.


✓ Asynchronous messages are sent from an object that will not
wait for a response from the receiver before continuing its tasks.

✓ Reply or Return Message


A reply message is drawn with a dotted line and an open
arrowhead pointing back to the original lifeline.

79 MASTER OF COMPUTER APPLICATION


Sequence Diagram(ATM Transaction)

80 MASTER OF COMPUTER APPLICATION


Collaboration Diagram
✓ What is a Collaboration diagram?
✓ The collaboration diagram is used to show the relationship
between the objects in a system.
✓ It is also called as communication diagram
✓ The purpose of Collaboration diagram is to visualize the
interactive behaviour of the system.
✓ Visualizing the interaction is a difficult task.
✓ Sequence and collaboration diagrams are used to capture the
dynamic nature but from a different angle.
✓ The sequence diagram captures the time sequence of the
message flow from one object to another.
✓ The collaboration diagram describes the organization of objects
in a system taking part in the message flow.

81 MASTER OF COMPUTER APPLICATION


Collaboration Diagram

✓ Following things are to be identified clearly before drawing the


interaction diagram.
✓ Object :
✓ The representation of an object is done by an object symbol with its
name and class underlined, separated by a colon.
✓ Objects taking part in the interaction.
✓ Actors:
✓ The actor plays the main role as it invokes the interaction.
✓ Links:
✓ The link is an instance of association, which associates the objects
and actors.
✓ Message flows among the objects.
✓ The sequence in which the messages are flowing.
✓ Object organization.
82 MASTER OF COMPUTER APPLICATION
Collaboration Diagram
❑ Notations of a collaboration diagram
✓ The four major components of a collaboration diagram are:
❑ Objects:
❑ Objects are shown as rectangles with naming labels inside.
❑ The naming label follows the convention of object name:
class name.
❑ Actors:
❑ Actors are instances that invoke the interaction in the diagram.
❑ Each actor has a name and a role, with one actor initiating the
entire use case.
❑ Links:
❑ Links connect objects with actors and are depicted using a solid
line between two elements.
❑ Each link is an instance where messages can be sent.

83 MASTER OF COMPUTER APPLICATION


Collaboration Diagram
❑ Notations of a collaboration diagram
❑ Links:
❑ Links connect objects with actors and are described using a solid
line between two elements.
❑ Each link is an instance where messages can be sent.
❑ Messages:
❑ Messages between objects are shown as a labelled arrow
placed near a link.

84 MASTER OF COMPUTER APPLICATION


Collaboration Diagram

85 MASTER OF COMPUTER APPLICATION


Collaboration Diagram

86 MASTER OF COMPUTER APPLICATION


Collaboration Diagram

87 MASTER OF COMPUTER APPLICATION


Collaboration Diagram

88 MASTER OF COMPUTER APPLICATION


Component Diagrams
❑ Component Diagram:
✓ A component diagram is used to break down a large object-
oriented system into the smaller components.
✓ It helps in forming an executable system.
✓ It is used to represent the functionality and behavior of all the
components present in the system.
✓ A component is a single unit of the system, which is replaceable
and executable.
✓ When to use a Component Diagram?
✓ To divide a single system into multiple components according to
the functionality.
✓ To represent the component organization of the system.
✓ The component diagram is used to visualize the static
implementation view of a system.

89 MASTER OF COMPUTER APPLICATION


Component Diagrams
Component Diagram Symbols and Notations
Component:
A component is a logical unit block of the system, a slightly higher
abstraction than classes.
It is represented as a rectangle with a smaller rectangle in the
upper right corner with tabs.
Interface:
An interface (small circle ) describes a group of operations used
(required) or created (provided) by components.
A full circle represents an interface created or provided by the
component.
A semi-circle represents a required interface, like a person's input.

90 MASTER OF COMPUTER APPLICATION


Component Diagrams
Dependencies:
Draw dependencies among components using dashed arrows.
Port:
Ports are represented using a square along the edge of the system or
a component.
A port is often used to help expose required and provided interfaces
of a component.

91 MASTER OF COMPUTER APPLICATION


Component Diagrams

92 MASTER OF COMPUTER APPLICATION


State chart/State Machines Diagrams:
➢ State chart diagram describes the flow of control from one state
to another state.
➢ States are defined as a condition in which an object exists.
➢ It changes when some event is triggered.
➢ The most important purpose of State chart diagram is to model
lifetime of an object from creation to termination.
➢ A state machine is a behavior that represents the sequences of
states that an object undergoes during its lifetime in response to
events
➢ The main purposes of using State chart diagrams :
➢ To model the dynamic aspect of a system.
➢ To model the life time of a reactive system.
➢ To describe different states of an object during its life time.
➢ Define a state machine to model the states of an object.
93 MASTER OF COMPUTER APPLICATION
State chart/State Machines Diagrams:
➢ How to Draw a Statechart Diagram?
✓ Initial state: It defines the initial state
(beginning) of a system.
✓ State box: It shows the conditions or
circumstances of a particular object of a class
at a specific point of time.
✓ Decision box: It is of diamond shape that
represents the decisions to be made on the
basis of an evaluated guard.
✓ Transition: A change of control from one state
to another due to the occurrence of some
event is termed as a transition.
✓ Final state: It represents the final state (end) of
a system.

94 MASTER OF COMPUTER APPLICATION


State chart/State Machines Diagrams:
➢ How to Draw a State chart Diagram?
➢ States
➢ 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.
➢ An object remains in a state for a finite amount of time.

95 MASTER OF COMPUTER APPLICATION


State chart/State Machines Diagrams:
Initial and Final States
First, the initial state, which indicates the default starting place of
control for the state machine or sub state.
Second, the final state, which indicates that the execution of the state
machine or the enclosing state has been completed.
Final state is represented as filled black circle enclosed in a hollow
circle.

96 MASTER OF COMPUTER APPLICATION


State chart/State Machines Diagrams:
Transitions
A transition is a relationship between two states indicating that an
object in one state will perform certain actions and enter another
state when a specified event occurs and specified conditions are
satisfied.

97 MASTER OF COMPUTER APPLICATION


State chart/State Machines Diagrams:

98 MASTER OF COMPUTER APPLICATION

You might also like