SD UML-UNIT-5
SD UML-UNIT-5
Component Diagram Model- Physical Aspect. -Logical Aspect. -Connections and Dependencies. –
User interface. -Initial DB design in a UML environment. Deployment ModelProcessors -Connections
-Components-Tasks-Threads -Signals and Events.
2. Interfaces
Specify a set of operations that a component offers or requires, serving as a
contract between the component and its environment.
Symbol: Circles (lollipops) for provided interfaces and half-circles (sockets)
for required interfaces.
Function: Define how components communicate with each other, ensuring that
components can be developed and maintained independently.
Interfaces
3. Relationships
Depict the connections and dependencies between components and interfaces.
Symbol: Lines and arrows.
o Dependency (dashed arrow): Indicates that one component relies on another.
o Association (solid line): Shows a more permanent relationship between components.
o Assembly connector: Connects a required interface of one component to a provided interface
of another.
Function: Visualize how components interact and depend on each other, highlighting communication paths
and potential points of failure.
Relationships
4. Ports
Role: Represent specific interaction points on the boundary of a component where interfaces are provided or
required.
Symbol: Small squares on the component boundary.
Function: Allow for more precise specification of interaction points, facilitating detailed design and
implementation.
5. Artifacts
6. Nodes
Represent physical or virtual execution environments where components are
deployed.
Symbol: 3D boxes.
Function: Provide context for deployment, showing where components reside
and execute within the system’s infrastructure.
Nodes
1. OnlineStore Component: This is the main component encapsulating the entire system. It includes three
internal components: Order, Customer, and Product.
2. Order Component: This component handles order-related operations within the Online Store. It is
connected to:
The Product component (which likely manages details of products in each order).
The Customer component (for associating orders with customers).
External access points via delegates (marked by <<delegate>> notation), which indicate that certain
internal actions can be routed or passed on to other parts.
3. Customer Component: This component manages customer-related data and activities.
It’s connected to the Order component to handle customer orders.
The Account component (outside of OnlineStore) is connected to Customer through a delegate,
suggesting that customer-related actions in OnlineStore might involve account information from
another system.
4. Product Component: This component manages product-related functions within the Online Store.
It’s linked to the Order component, allowing orders to reference available products.
5. Account Component: This component is located outside the OnlineStore boundary, indicating it may be a
separate system or module. It connects to Customer through a dotted line with a delegate, showing
that OnlineStore can delegate certain account-related functions to this external Account component.
Tools and Software available for Component-Based Diagrams
Several tools and software are available for creating Component-Based Diagrams, ranging from general-purpose
diagramming tools to specialized UML modeling software. Here are some popular options:
Lucidchart: Lucidchart is a cloud-based diagramming tool that supports creating various types of
diagrams, including Component-Based Diagrams.
Microsoft Visio: Microsoft Visio is a versatile diagramming tool that supports creating Component-Based
Diagrams and other types of UML diagrams.
Visual Paradigm: Visual Paradigm is a comprehensive UML modeling tool that supports the creation of
Component-Based Diagrams, along with other UML diagrams.
Enterprise Architect: Enterprise Architect is a powerful UML modeling and design tool used for creating
Component-Based Diagrams and other software engineering diagrams.
IBM Rational Software Architect: IBM Rational Software Architect is an integrated development
environment (IDE) for modeling, designing, and developing software systems.
Applications of Component-Based Diagrams
As they facilitate communication, documentation, and system design, component-based diagrams are crucial to
software development. These are some important applications for them:
System Design and Architecture: By displaying the parts (components), their connections, and any
dependencies between them, these diagrams help architects and designers in understanding the structure of
a system.
Requirements Analysis: These diagrams help clients and developers in understanding the functional (what
the system should accomplish) and non-functional (performance, security, etc.) requirements of the system.
System Documentation: Component-Based Diagrams act as useful records of how the system is built,
capturing big-picture design and architectural decisions for future reference.
Software Development: These diagrams guide developers during the build phase, clearly outlining
component boundaries and how different parts of the software should interact.
Code Generation and Implementation: Sometimes, these diagrams can be a starting point for generating
code automatically, speeding up the process of building out the software components.
System Maintenance and Evolution: As the system grows or changes, these diagrams are helpful for
understanding the current architecture, making updates easier and more organized.
Benefits of Using Component-Based Diagrams
Throughout the software development lifecycle, using component-based diagrams helps with software system
design, communication, and maintenance. Here are a few main benefits:
Visualization of System Architecture: Component-Based Diagrams give the architecture of the system,
including its dependencies, interfaces, and components, a visual representation.
Modularity and Reusability: By dividing complex structures into more manageable, reusable parts,
component-based diagrams encourage modularity.
Improved Communication: A consistent visual language for communication between project managers,
developers, architects, and testers is provided by component-based diagrams.
Ease of Maintenance and Evolution: Component-Based Diagrams help in system maintenance and
evolution by providing a clear documentation of system architecture.
Enforcement of Design Principles: Component-Based Diagrams help enforce design principles such as
encapsulation, cohesion, and loose coupling.
A Deployment Diagram is a type of Structural UML Diagram that shows the physical deployment of software
components on hardware nodes. It illustrates the mapping of software components onto the physical
resources of a system, such as servers, processors, storage devices, and network infrastructure.
A component represents a modular and reusable part of a system, typically implemented as a software
module, class, or package. It encapsulates its behavior and data and can be deployed independently.
Typically represented as a rectangle with two smaller rectangles protruding from its sides, indicating ports
for connections. The component's name is written inside the rectangle.
2. Artifact
An artifact represents a physical piece of information or data that is used or produced in the software
development process. It can include source code files, executables, documents, libraries, configuration files,
or any other item.
Typically represented as a rectangle with a folded corner, labeled with the artifact's name. Artifacts may
also include additional information, such as file extensions or versions.
3. Interface
An interface defines a contract specifying the methods or operations that a component must implement. It
represents a point of interaction between different components or subsystems.
Represented as a circle or ellipse labeled with the interface's name. Interfaces can also include provided and
required interfaces, denoted by "+" and "-" symbols, respectively.
4. Node
A node represents a physical or computational resource, such as a hardware device, server, workstation, or
computing resource, on which software components can be deployed or executed.
Represented as a box with rounded corners, usually labeled with the node's name. Nodes can also include
nested nodes to represent hierarchical structures.
5. Communication path
A straight line that represents communication between two device nodes. Dashed lines in deployment
diagrams represents relationships or dependencies between elements, indicating that one element is related to
or dependent on another.
Use Cases of Deployment Diagrams
Below are the use cases of deployment diagrams:
Deployment diagrams help plan how software systems will be set up on different devices.
They help design the hardware needed to support the software. By showing which software parts go
where, they help decide what devices and networks are needed.
Deployment diagrams make sure each part of the software has enough resources, like memory or
processing power, to run well.
They show how different parts of the software depend on each other and on the hardware.
By seeing how everything is set up, teams can find ways to make the software run faster and smoother.
Steps for creating a Deployment Diagram
Below are the main steps for creating a deployment diagram:
Step1: Identify Components: List all software parts and hardware devices that will be in the
deployment diagram.
Step 2: Understand Relationships: Figure out how these parts connect and work together.
Step 3: Gather Requirements: Collect details about hardware, network setups, and any special rules for
deployment.
Step 4: Draw Nodes and Components: Start by drawing the hardware devices (nodes) and software
parts (components) using standard symbols roughly at first improvise it and draw the final one.
Step 5: Connect Nodes and Components: Use lines or arrows to show how nodes and components are
linked.
Step 6: Add Details: Label everything clearly and include any extra info, like hardware specs or
communication protocols.
Step 7: Documentation: Write down any important decisions or assumptions made while creating the
diagram.
Deployment Patterns
Deployment patterns are standardized methods for efficiently installing software on hardware infrastructure.
They offer guidance for organizing and deploying software components, addressing challenges
like scalability, reliability and performance.
Client-Server Deployment: Illustrates the connection between client applications and server nodes in a
client-server architecture.
Three-Tier Architecture : Shows the distribution of presentation, application logic, and data storage
components across different nodes.
Microservices Architecture : Depicts how individual microservices are deployed on separate nodes or
containers.
Containerization: Displays the deployment of different containers on host machines using technologies
like Docker.
Cloud Deployment: Illustrates the distribution of components across various cloud services or regions in
a cloud environment.
Real-World Examples For Deployment Diagram
Below are the real-world examples for deployment diagram:
Example 1:
Deployement Diagram For Mobile Banking Andorid Services.
In this example, one node represents the client’s Android device. The components represent the software
installed on these devices, with the banking application being the specific component on the Android device.
The diagram also shows how the user connects to the banking server through the web.
This means the user opens the banking app on their Android device, which then talks to the application
server online to carry out tasks like checking account balances or transferring money.
Overall, the deployment diagram visually illustrates how software components are set up on hardware nodes
and how they interact to provide the necessary functions to the user.
Below is the explanation of the above example:
Login or Registration: Users start by entering their credentials to access the exam registration system.
New users must register by providing details like their name, email, and contact number.
Select Exam: After logging in or registering, users can choose the exam they want to sign up for. This
involves picking from available exams, checking dates and locations, and ensuring they meet eligibility
requirements.
Manage Profile and Status: Users can update their profiles, check their registration status, and print e-
receipts.
View Profile: Users can access their registered information to confirm its accuracy, update contact
details, print e-receipts, and save their profile.
Payment: After selecting an exam, users go to the payment page to pay the exam fee using options like
credit/debit cards, net banking, or digital wallets.
Test: After registration and payment, users can access sample tests or practice papers, if available, to
prepare for the exam.
View Result: Once the exam is finished, users can log in to their account to check their results.
Report: Users may receive various reports, such as scorecards, response sheets, or feedback forms,
depending on the exam and the policies of the examination board
Benefits of Deployment Diagrams
Below are the benefits of deployment diagram:
Deployment diagrams provide a clear picture of how software parts are placed on hardware, making it
easy to understand
They help teams talk about how to set up the system, making it easier to discuss and decide on
deployment strategies.
Deployment diagrams assist in planning and managing the deployment process, ensuring resources are
used efficiently and system requirements are met.
They serve as useful documentation for understanding how the system is set up, helping with
maintenance and future changes.
Challenges of Deployment Diagrams
Below are the challenges of deployment diagram:
Deployment diagrams can get complicated and especially in big systems with lots of parts. Managing this
complexity is tough.
Making and understanding deployment diagrams needs knowledge of UML symbols, which not everyone
might have.
Updating deployment diagrams when the system changes takes time and effort.
Deployment diagrams might not show how things change over time or in real-life use.
Making deployment diagrams often needs lots of people to work together, which can be tricky
Relationships
Graphically, a component diagram is a collection of vertices and arcs and commonly contain components,
interfaces and dependency, aggregation, constraint, generalization, association, and realization relationships. It
may also contain notes and constraints.
Relationships Notation
Association:
Composition:
Aggregation
Constraint
Dependency
Links:
Either by forward or reverse engineering, identify the set of source code files of interest and model
them as components stereotyped as files.
For larger systems, use packages to show groups of source code files.
Consider exposing a tagged value indicating such information as the version number of the source code
file, its author, and the date it was last changed. Use tools to manage the value of this tag.
Model the compilation dependencies among these files using dependencies. Again, use tools to help
generate and manage these dependencies.
User interfaces
User interfaces (UIs) are modeled as components in software design to separate the visual and
interaction layer from the back-end logic. Components are reusable, modular, and encapsulate both
the structure (layout) and behavior (interaction logic) of the UI.
UI Layer:
Function:
Captures user input.
Initiates actions (e.g., sending data or making a request) via buttons or form
submissions.
Displays feedback or results based on responses from the back-end.
Controller Layer:
Function:
Arrows:
From UI Layer to Controller Layer: Represents the flow of user actions (e.g., login
credentials submitted via API).
From Controller Layer to Back-End Layer: Represents the communication of these
actions as API requests.
Back-End Layer:
Handles business logic, processes data, and communicates with databases or external
services.
Sends responses back to the controller layer after processing.
Function:
Interaction Process:
1. User Action:
o The user interacts with the UI Layer by filling out the login form and clicking the
"Submit" button.
2. Request to Back-End:
o The UI Layer sends an API request (e.g., login credentials) to the Controller Layer.
o The Controller forwards this request to the Back-End Layer for processing.
3. Processing:
o The Back-End Layer verifies the credentials using its Business Logic and checks the
database for matching records.
4. Response:
o The Back-End Layer sends a response (e.g., success or error) back to the Controller
Layer.
o The Controller formats this response (if needed) and forwards it to the UI Layer.
5. User Feedback:
o The UI Layer updates the interface based on the response. For example:
Displays "Login Successful" or "Invalid Credentials."
1. Requirements Analysis
Gather and analyze the functional and non-functional requirements of the system.
Identify the key entities, their attributes, and the relationships between them.
Define the constraints, such as primary keys, foreign keys, and unique constraints.
4. Add Constraints
If your database interacts with the application or other systems, use a UML Sequence
Diagram to model the flow of interactions.
This step helps understand how data flows to and from the database in various use cases.
Review the diagrams with stakeholders to ensure they meet the system requirements.
Check for missing entities, attributes, or relationships.
Ensure the design adheres to best practices, such as normalization and scalability.
Convert the UML diagrams into a physical database schema using tools like MySQL,
PostgreSQL, or Oracle.
Use tools like ArgoUML, Lucidchart, or Enterprise Architect to generate SQL scripts directly
from the UML diagrams.
Entities:
Relationships:
In deployment diagrams, processors are essential for modeling the hardware infrastructure of
a system. They illustrate where software components are executed, how resources are
allocated, and how the system's hardware is organized. By representing processors clearly,
architects can ensure that the deployment model aligns with performance, scalability, and
resource utilization requirements.
Definition of Processors
2. Resource Allocation:
o Help in visualizing how hardware resources are allocated to specific software
components.
o Ensure efficient use of available processing power.
3. Performance Modeling:
o Processors provide insights into system performance, enabling designers to assess
whether the hardware can meet the system's demands.
4. Interaction Representation:
o They show communication between different processors, which is vital in distributed
or parallel systems
plaintext
CopyEdit
+-------------------+
| Node: Server |
| ----------------- |
| Processor: CPU |
| Software: App1 |
+-------------------+
Example 2: Multi-Processor System
plaintext
CopyEdit
+-------------------+ +-------------------+
| Node: Server1 | | Node: Server2 |
| ----------------- | | ----------------- |
| Processor: CPU1 | <------> | Processor: CPU2 |
| Software: App1 | | Software: App2 |
+-------------------+ +-------------------+
In the context of UML deployment diagrams, tasks and threads represent the execution units
of a system. They help illustrate the runtime behavior and concurrency within a system.
Tasks
Threads
In deployment diagrams, tasks and threads are represented implicitly or through annotations.
Specific symbols or stereotypes can be used to denote their existence within a node or a
component.
Consider a system where a server node performs two tasks: processing requests and handling
logging.
plaintext
CopyEdit
+------------------+
| Node: Server |
| ---------------- |
| Task: Request |
| Processing |
| Task: Logging |
+------------------+
Example 2: Thread Representation
A multi-threaded application running on a node, such as a web server handling multiple client
requests:
plaintext
CopyEdit
+------------------+
| Node: WebServer |
| ---------------- |
| Task: HTTP |
| Threads: |
| - Thread 1 |
| - Thread 2 |
| - Thread 3 |
+------------------+
Example 3: Tasks and Threads Together
plaintext
CopyEdit
+-------------------+ +--------------------+
| Node: Client | | Node: Server |
| ----------------- | | ------------------ |
| Task: SendRequest | ----> | Task: Process |
+-------------------+ | Threads: |
| - Thread A |
| - Thread B |
+--------------------+
1. Concurrency Representation:
o Tasks and threads are used to model parallelism and multi-threading in the system.
2. Resource Mapping:
o Help allocate tasks to specific hardware nodes or processors for performance
modeling.
3. Scalability:
o Show how threads are used for scalability in multi-threaded systems, such as web
servers or real-time systems.