Professional Documents
Culture Documents
OOSD Notion 1
OOSD Notion 1
2. Behavioral Things
State Machine
It is a behaviour that specifies the sequences of states an object goes through during
its lifetime is response to events, together with its responses to those events.
Graphically, a state is rendered as a round edged rectangle, including its name and
its substates.
3. Grouping Things
Grouping things are the organizational parts of UML models.
Package
A package is a general-purpose mechanism for organizing the design itself, as
opposed to classes, which organize implementation
constructs.
Structural things, behavioral things, and even other grouping things may be
placed in a package. Unlike components (which exist at run time), a package is
purely conceptual (meaning that it exists only at development time).
4. Annotational Things
Annotational things are the explanatory parts of UML models.
Unit 1 1
These are the comments you may apply to describe, illuminate, and remark
about any element in a model.
Note
A note is simply a symbol for rendering constraints and comments attached to
an element or a collection of elements.
Relationship
There are four kinds of relationships in UML:
1. Dependency
2. Association
3. Generalization
4. Realization
Dependency
A dependency is a semantic relationship between two model elements in which
a change to one element (the independent
one) may affect the semantics of the other element (the dependent one).
Unit 1 2
Association
An association is a structural relationship among classes that describes a set of
links, a link being a connection among objects that are instances of the classes.
Multiplicity
Unit 1 3
Generalization
A generalization is a specialization/generalization relationship in which the
specialized element (the child) builds on the specification of the generalized
element (the parent).
The child shares the structure and the behavior of the parent.
Realization
A realization is a semantic relationship between classifiers, wherein one class
specifies something that another class will perform.
Diagrams in UML
Unit 1 4
A diagram is the graphical presentation of a set of elements, most often
rendered as a connected graph of vertices (things) and paths (relationships).
UML is linked with object oriented design and analysis. UML makes the use of
elements and forms associations between them to form diagrams. Diagrams in
UML can be broadly classified as:
Common Mechanism
The UML is made simpler by the presence of four common mechanisms that apply
consistently throughout the language.
1. Specifications
Behind every graphical notation in UML there is a precise specification of the details
that element represents.
For example, a class icon is a rectangle and it specifies the name, attributes and
operations of the class.
Unit 1 5
2. Adornments
The mechanism in UML which allows the users to specify extra information with the
basic notation of an element is the adornments.
3. Common divisions
In UML there is clear division between semantically related elements like:
separation between a class and an object and the separation between an
interface and its implementation.
Here there is one class, named Customer, together with three objects:
4. Extensibility mechanism
UMLs extensibility mechanisms allow the user to extend (new
additions) the language in a controlled way. The extensibility
mechanisms in UML are:
Unit 1 6
a )Stereotypes — Extends the vocabulary of UML. Allows users to
declare new building blocks (icons) or extend the basic notations of
the existing building blocks by stereotyping them using guillemets (<< >>).
Class Diagram
Unit 1 7
A class is a description of a set of
objects that share the same attributes,
operations, relationships, and semantics.
Unit 1 8
An attribute is a named property of a
/age : Date
(+)public
(#)protected
(-)private
( / ) derived
Unit 1 9
A class diagram in the Unified Modeling Language (UML) is a type of static structure
diagram that describes the structure of a system by showing the classes, interfaces,
objects, and their relationships. A class diagram is a graphical representation of a
system's classes, interfaces, and objects, and the relationships between them.
Class diagrams can also show the relationships between classes, such as
inheritance, association, aggregation, and composition. These relationships are
represented by lines connecting the classes, with arrows pointing in the direction of
the relationship.
Unit 1 10
Object Diagram
An object diagram is a type of UML (Unified Modeling Language) diagram that
shows a snapshot of the instances of the classes in a system, along with their
relationships and attributes. It provides a detailed view of the objects in a system and
their relationships at a specific point in time.
An object diagram is similar to a class diagram, but it shows the actual instances of
the classes and their current state, rather than the class definitions.
Purpose:
Unit 1 11
Sequence Diagram
A sequence diagram is a type of UML (Unified Modeling Language) diagram that
shows the interactions between objects or components in a system, and the order in
which these interactions occur. It is used to model the dynamic behavior of a system
and to describe the interactions between objects in a system.
Sequence diagrams can be used to model the flow of messages between objects,
the order in which the messages are sent and received, and the objects that are
involved in the interactions. They are useful for understanding the interactions
between objects in a system and for identifying potential design issues. They are
also useful for describing the flow of control in a system, and for generating code or
test cases.
Unit 1 12
Unit 1 13
1. Lifeline: Represented by a vertical dashed line, a lifeline represents an instance
of an object or component in the system.
Unit 1 14
7. Recursive message: Represented by a message arrow that loops back to the
same object, a recursive message is used to indicate that an object or
component is sending a message to itself.
8. Self message: Represented by a message arrow that loops back to the same
object, a self message is used to indicate that an object or component is sending
a message to itself.
Collaboration Diagram
Collaboration refers to the interaction between objects in a system to achieve a
common goal. Objects in a system send messages to each other, calling methods
and passing data, to coordinate their actions and achieve the desired behavior of the
system. Collaboration between objects allows for the division of a complex problem
into smaller, more manageable parts that can be solved independently, and then
combined to achieve the overall solution.
Unit 1 15
Messages: Represented as arrows pointing from one object to another,
indicating that a message or request is sent from one object to another. The
message is labeled with the name of the operation or method being called.
Return message: Represented as a message going back to the sender after the
operation is finished.
Additionally, the collaboration diagram can also show return message, which is
represented as an arrow going back to the sender object after the operation is
Unit 1 16
finished. This is represented by a dotted arrow going back to the sender object along
with the name of the operation or method being returned.
Unit 1 17
Use Case
A use case is a description of a set of interactions between a system and its actors
(users or other systems) to achieve a specific goal or objective. It is a technique
used in software engineering to capture the requirements of a system and to
describe how the system should behave in different scenarios.
A use case is typically described as a series of steps, called use case scenarios, that
show how the system should respond to different inputs and conditions. Each
scenario begins with a specific goal or objective, and then describes the interactions
between the system and its actors, including the inputs provided by the actors, the
actions taken by the system, and the results or outputs produced by the system.
Use cases are used to model the functional requirements of a system, to understand
the interactions between the system and its actors, and to identify potential design
issues. They are also useful for testing and debugging the system, and for
documenting the system's design.
A use case diagram is a type of UML (Unified Modeling Language) diagram that
shows the interactions between actors and a system, and the goals or objectives
that the actors want to achieve using the system. It is a visual representation of the
use cases and their relationships in a system.
In a use case diagram, actors are represented by stick figures, and the system is
represented by a rectangle. The interactions between actors and the system are
represented by lines connecting the actors and the system, with arrows indicating
the direction of the interaction. The use cases themselves are represented by ovals,
which are labeled with the name of the use case.
Use case diagrams are used to model the high-level functionality of a system and to
understand the interactions between actors and the system. They are useful for
identifying the main goals and objectives of the system, and for understanding the
relationships between the use cases. They can also be used to identify potential
design issues, and to test and debug the system.
Use case diagrams are also useful for communication, as they provide a clear visual
representation of the system's functionality, making it easier for stakeholders and
developers to understand the requirements and design of the system. They are also
useful for documentation, as they provide a clear and concise summary of the
system's functionality.
Unit 1 18
1. Actor: Represented by a stick figure, an actor represents an external entity that
interacts with the system, such as a user or another system.
Unit 1 19
6. Extend: Represented by a dotted arrow with an open arrowhead pointing from
one use case to another, an extend relationship is used to indicate that one use
case can be extended by another use case in certain conditions.
Activity Diagram
An activity diagram is a type of UML (Unified Modeling Language) diagram that
shows the flow of activities or actions in a system. It is used to model the dynamic
behavior of a system and to describe the flow of control in a system.
In an activity diagram, the flow of activities is represented by a series of connected
shapes, such as rectangles, diamonds, and ovals. Each shape represents a specific
action or decision point in the flow of activities. Transitions between shapes are
represented by arrows, which indicate the flow of control from one action to the next.
It's also important to note that Activity diagrams are closely related to flowcharts, but
activity diagrams are more expressive, as they provide more options to represent
different types of actions, such as parallel and concurrent activities, and also they
include notation for decision points, looping and more.
Unit 1 20
Unit 1 21
Example:
Unit 1 22
State Machine Diagram
A state machine diagram, also known as a state diagram or statechart diagram, is a
type of UML (Unified Modeling Language) diagram that shows the states of an object
or a system, the events that cause the object or system to transition between states,
and the actions that are performed as a result of these events. It is used to model
the behavior of an object or a system, and to understand how it responds to different
inputs and conditions.
In a state machine diagram, the states of an object or a system are represented by
circles or rectangles, and the transitions between states are represented by arrows.
Each transition is triggered by a specific event, and is accompanied by a guard
condition, which determines whether the transition can take place.
It's important to note that State machine diagrams are particularly useful for
modeling reactive systems which change their behavior based on events and
internal or external conditions. They are also useful for modeling the behavior of an
object in different states, and to represent the event-condition-action rules that
govern the transition between states.
Unit 1 23
Unit 1 24
Example:
Unit 1 25
Component Diagram
Unit 1 26
Unit 1 27
Unit 1 28
Unit 1 29
Deployment Diagram
A deployment diagram is a type of UML (Unified Modeling Language) diagram that
shows the physical deployment of software components, hardware components, and
other artifacts on a target platform. It is used to model the physical architecture of a
system and to understand how the system is deployed on the target platform.
Unit 1 30
Unit 1 31