Chapter 2
Chapter 2
1. Class Diagram:
o Represents the static structure of a system.
o Shows classes, their attributes, methods, and relationships
(associations, inheritances, etc.).
2. Use Case Diagram:
o Show cases the functional requirements of a system.
o Shows actors (users or other systems) and their interactions with use
cases.
3. Sequence Diagram:
o Displays how objects interact in a particular scenario of a use case.
o Focuses on the order of messages exchanged between objects.
4. Activity Diagram:
o Represents the flow of control or data in a system.
o Useful for modeling business processes and workflows.
5. State Diagram:
o Shows the states of an object and transitions between those states.
o Useful for modeling the lifecycle of an object.
6. Component Diagram:
o Shows how a system is divided up into several parts and how they are
dependent on one another.
The Unified Modeling Language (UML) can be applied in various domains and
stages of software development. Here are some key areas where UML is
particularly useful:
1. Software Development
2. System Architecture
Micro services: UML can model the interactions and dependencies between
micro services.
Distributed Systems: Deployment diagrams help visualize the physical
arrangement of system components across nodes.
4. Database Design
7. Agile Development
8. Model-Driven Development
The Unified Modeling Language (UML) consists of several building blocks that
form the foundation for creating various types of diagrams. These building blocks
can be categorized into three main groups: Structural Elements, Behavioral
Elements, and Group Elements. Here’s a detailed overview of each category:
1. Structural Elements
These elements represent the static components of the system and define the
system's structure.
Classes:
o Define the blueprint for objects, including attributes (data) and
methods (functions).
Interfaces:
o Define a set of operations without providing the implementation by specifying an
agreement that classes can implement.
Objects:
o Instances of classes, representing specific items within the system.
Components:
Nodes:
o Physical or virtual devices in a system, used in deployment diagrams
to represent hardware.
Packages:
o Containers for grouping related elements, helping organize the model
and manage dependencies.
2. Behavioral Elements
These elements describe the dynamic components of the system, focusing on how
the system behaves and interacts over time.
Use Cases:
o Show how actors and the system interact to represent functional needs from the
viewpoint of the user.
Interactions:
o Provide collaboration and sequence diagrams that show how objects communicate
with one another through messages.
State Machines:
o Define the states of an object and transitions between those states,
show the lifecycle of an object.
Activities:
o Represent workflows and business processes, showing the sequence
of actions and decisions.
3. Group Elements
These elements are used for organizing and structuring the model. They help to
manage complexity by grouping related components and providing additional
context. Here are the primary types of Group Elements in UML:
Notes:
Notes are textual annotations that can be applied to any UML element.
Constraints/ Limitations:
rules that are applied to model components in order to ensure that particular
characteristics are maintained.
2.2. Relationships in the UML
1. Association
3. Composition
4. Generalization
5. Realization
Definition: a connection that shows how one element depends on another for
implementation or definition.
Characteristics:
o Shown with an open arrow pointing to the independent element and a dashed line.
o Shows a weaker relationship; the dependent element may be impacted by changes
in the independent element.
8. Interaction Relationships
Interaction Relationships in the Unified Modeling Language (UML)
represent how objects or components within a system communicate and
collaborate to achieve specific behaviors.
types of interaction relationships in UML: