You are on page 1of 23

Software Design and Architecture

Laboratory # 05

9/26/2023
UET TAXILA
Engr. Sidra Shafi

CLO Learning Outcomes Assessment Item BT Level PLO


No.
1 Construct the experiments / projects Lab Task, Mid Exam,
of varying complexities. Final Exam, Quiz,
P2 3
Assignment, Semester
Project
2 Use modern tool and languages. Lab Task, Semester
P2 5
Project
3 Demonstrate an original solution of Lab Task, Semester
A2 8
problem under discussion. Project
4 Work individually as well as in teams Lab Task, Semester A2 9
Project
Deployment Diagram
Statement Purpose:
After this Lab, students will be able to understand and implement:
• Environmental Diagrams: Deployment Diagrams

UML Tool: Star UML version 5.


Download Link: https://staruml.informer.com/versions/

All UML diagrams can be useful to describe aspects of the architectural model. Four UML
diagrams are particularly suitable for architecture modeling:
• Package diagrams
• Subsystem diagrams
• Component diagrams
• Deployment diagrams

UML diagrams represent these two aspects of a system:


• Structural (or Static) view: emphasizes the static structure of the system using objects,
attributes, operations and relationships. It includes class diagrams and composite
structure diagrams.
• Behavioral (or Dynamic) view: emphasizes the dynamic behavior of the system by
showing collaborations among objects and changes to the internal states of objects. This
view includes sequence diagrams, activity diagrams, and state machine diagrams.

Deployment diagram come under the category of Structure Diagrams.


Enviornmental Diagram: The diagram in this category explains the after deployment behavior
of the software model. This diagram usually explains the user interactions and software effects on
the system.

Deployment Diagram:
Deployment Diagram shows execution architecture of systems that represent the assignment
(deployment) of software artifacts to deployment targets (usually nodes).

Nodes represent either hardware devices or software execution environments. They could be
connected through communication paths to create network systems of arbitrary
complexity. Artifacts represent concrete elements in the physical world that are the result of a
development process and are deployed on nodes.

3rd Semester UET TAXILA


Note, that components were directly deployed to nodes in UML 1.x deployment diagrams. In
UML 2.x artifacts are deployed to nodes, and artifacts could manifest (implement) components.
So components are now deployed to nodes indirectly through artifacts.

Purpose of Deployment Diagram


The main purpose of the deployment diagram is to represent how software is installed on the
hardware component. It depicts in what manner a software interacts with hardware to perform its
execution.

Both the deployment diagram and the component diagram are closely interrelated to each other as
they focus on software and hardware components. The component diagram represents the
components of a system, whereas the deployment diagram describes how they are deployed on the
hardware.

The deployment diagram does not focus on the logical components of the system, but it put its
attention on the hardware topology.

Following are the purposes of deployment diagram enlisted below:

1. To envision the hardware topology of the system.


2. To represent the hardware components on which the software components are installed.
3. To describe the processing of nodes at the runtime.

How to draw a Deployment Diagram?

The deployment diagram portrays the deployment view of the system. It helps in visualizing the
topological view of a system. It incorporates nodes, which are physical hardware. The nodes are
used to execute the artifacts. The instances of artifacts can be deployed on the instances of nodes.

One of the essential elements of the deployment diagram is the nodes and artifacts. So it is
necessary to identify all of the nodes and the relationship between them. It becomes easier to
develop a deployment diagram if all of the nodes, artifacts, and their relationship is already known.

Deployment Diagram guidelines:

Before you begin diagramming, ask yourself these questions:

1. Have you identified the scope of your system? For example, you should know
whether you are diagramming a single application or the deployment to a whole network
of computers.

2. What are the limitations of your physical hardware? What legacy systems will you
need to interact with? Make sure that you know the operating software and protocols
you will be working with and what monitoring you will be putting into place.

3rd Semester UET TAXILA


3. Which distribution architecture are you using? You should know how many tiers
your application will have and what application you will deploy to.

4. Do you have all the nodes you need? Do you know how they are all connected?

5. Do you know which components are going to be on which nodes?

Elements of Deployment Diagrams:


Following elements can be used in a deployment diagram.

• Artifact: Aproduct developed by the software, symbolized by a rectangle with the name
and the word “artifact” enclosed by double arrows.

• Association: A line that indicates a message or other type of communication between


nodes.

• Dependency: A dashed line that ends in an arrow, which indicates that one node or
component is dependent on another.

• Node: A hardware or software object, shown by a three-dimensional box.

➢ There are two types of nodes in a deployment diagram: device nodes and execution
environment nodes. Device nodes are computing resources with processing
capabilities and the ability to execute programs. Some examples of device nodes
include PCs, laptops, and mobile phones.

➢ An execution environment node, or EEN, is any computer system that resides


within a device node. It could be an operating system, a JVM, or .NET.

Figure 1: Device Node (Server PC) and Execution Node (JVM)

• Node as container: A node that contains another node inside of it

• Package: A file-shaped box that groups together all the device nodes to encapsulate the
entire deployment.

3rd Semester UET TAXILA


Deployment Diagram Example:
This example shows a basic deployment diagram for a website. There is a web server, a database
server, and the machine where the user views the website. This example gives you an idea of how
a deployment looks in UML notation.

Figure 2: Deployment Diagram of a Website

Example:

Figure 3: Deployment Diagram of a Hotel Reservation System

3rd Semester UET TAXILA


Figure 3 provides an example of a deployment diagram for part of the hotel reservation system.
Two artifacts residing on the Reservation Server node—
ReservationLogic and Persistence.jar. ReservationLogic depends on the Persistence.jar file
because at runtime instances in the ReservationLogic file must invoke instances in
the Persistence.jar file. The Persistence.jar file depends on the Rdbms.exe executable file that
resides on the Database Server node.

You may notice that the diagram shows two ways to indicate an artifact’s dependency on a
component. For the ReservationLogic artifact, the component dependency is shown as a
property {component = Reservations Business Logic}. For the Persistence.jar artifact, the
dependency is shown with a dashed line and an arrow pointing to the PersistentStore component.

Node as a Container:

A node can contain other elements, such as components or artifacts. The following diagram shows
a deployment diagram for part of an embedded system, depicting an executable artifact as being
contained by the motherboard node.

Figure 4: Node as a Container

Figure 5: Deployment can be shown as a dependency

3rd Semester UET TAXILA


Figure 6: A Software Node may be nested within a hardware Node.

Just as an execution environment (or another hardware node) can be nested within a hardware
node, so can one execution environment be nested within another. In the diagram below, for
example, the «web server» execution environment is nested within the «OS» execution
environment (note that in both execution environment nodes, the «execution
environment» stereotype has been substituted by an application-specific stereotype).

Figure 7: One execution environment can be nested within another

In the example above, the device node could represent any number of Dell PowerEdge servers,
each running the Linux operating system and playing host to Apache web server software. The
example below shows a specific instance of Apache running over a specific instance of Linux
installed on a specific server called WebServer1.

Figure 8: Nested Node instances

3rd Semester UET TAXILA


In cases where more than one artifact is deployed to a deployment target, or even in cases where
artifacts are deployed to different deployment targets, there may be a dependency between one
artifact and another (i.e. one artifact relies on services provided by another artifact). This
dependency is shown in the normal manner (using a dependency arrow from the artifact that
requires the services to the artifact that provides them.

Figure 9: The Organiser.exe artifact depends on the Organiser.dll artifact

Communication Path:

Nodes may be connected to other nodes via associations that represent communication paths,
indicating that communication may take place between the nodes.

A communication path may exist, for example, between a hardware node representing an
application server and another hardware node that represents a client workstation. A
communication path is drawn as a solid line connecting two nodes. The type of communication
being modeled can be shown using an appropriate stereotype.

In the example below, the model describes a desktop computer communicating with an intranet
server over an Ethernet connection. Note, however, that communication paths can also represent
wireless connections. We can use hardware nodes and the communication paths between them to
model the topology of a network.

Figure 10: A communication path stereotyped as an Ethernet connection

A communication path can also be used to show that communication may take place between
execution environment nodes. The stereotype used for a communication path should reflect the
type of communication we are interested in modeling. In the example below, the association is
stereotyped as a TCP/IP connection. Although the data will obviously be transmitted via some
physical transmission medium, such as an Ethernet connection, we are interested here in the
communication between two execution environments. In this case, the execution environments
happen to be a web browser and a web server, which requires the use of the TCP/IP protocols.

3rd Semester UET TAXILA


Figure 11: A communication path between execution environment nodes

Modeling in Star UML:

The following elements are available in a deployment diagram.

• Package
• Node
• NodeInstance
• Artifact
• Port
• Part
• Association
• DirectedAssociation
• Dependency
• Link
• Connector

Package:

A package is a grouping of model elements. Packages themselves may be nested within other
packages. A package may contain subordinate packages as well as other kinds of model elements.
All kinds of UML model elements can be organized into packages.

It is used to show the logical groupings of nodes.

Note: Steps for creating package were already discussed in lab.

3rd Semester UET TAXILA


Node:

A node is a run-time physical object that represents a computational resource, generally having at
least a memory and often processing capability as well, and upon which components may be
deployed.

Steps for creating node:

To create Node in deployment diagram,

1. Click [Toolbox] -> [Deployment] -> [Node] button.

2. Click at the position where Node will be placed in the [main window].

3. Then node is created and the quick dialog appears. Enter the node name at the quick
dialog.

4. And press [Enter] key.

3rd Semester UET TAXILA


Steps for adding deployed component:

To add deployed component to node

1. Select [Collection Editor...] popup menu of node.

2. Or click button in [DeployedComponents] property on properties window.

3rd Semester UET TAXILA


3. At the [Deployed Components] tab of the [collection editor], you can add deployed
component by using button.

4. At [Select the Component to deploy] dialog, select deployed component. To select


component, you have already made some component.

3rd Semester UET TAXILA


5. And click OK button. Then deployed component is added to the node.

6. The node is shown as following.

Steps for adding deployed artifact:

To add deployed artifact to node:

1. Select [Collection Editor...] popup menu of node.


2. Or click button in [DeployedArtifacts] property on properties window.

3rd Semester UET TAXILA


3. At the [Deployed Artifacts] tab of the [collection editor], you can add deployed artifact
by using button.

4. At the [Select a Artifact] dialog, select a deployed artifact and click [OK] button.

5. Then the artifact is add to the node and the node is shown as following.

3rd Semester UET TAXILA


Steps for creating port

To create port on a node,

1. Click [Toolbox] -> [Deployment] -> [Port] button.

2. Click the node where the port will be contained in the [main window].

3. A port is created on the node and the quick dialog appears. Enter the port name at the
quick dialog.

4. And press [Enter] key. The result is like the following.

Steps for creating part

To create part on a node,

3rd Semester UET TAXILA


1. Click [Toolbox] -> [Deployment] -> [Part] button.

2. Click the node where the part will be contained in the [main window].

3. Finally, a part is created on the node as following.

Steps for creating connectors

To create connector between two parts,

3rd Semester UET TAXILA


1. Click [Toolbox] -> [Deployment] -> [Connector] button.

2. Drag from one part and drop to the other part in the [main window].

3. The result is as follows.

Node Instance:

A node instance is an instance of a node. A collection of component instances may reside on the
node instance. An instance can be distinguished from a node by the fact that its name is underlined
and has a colon before its base node type. An instance may or may not have a name before the
colon. The following diagram shows a named instance of a computer.

3rd Semester UET TAXILA


Steps for creating node instance

To create NodeInstance in deployment diagram,

1. Click [Toolbox] -> [Deployment] -> [NodeInstance] button.

2. Click at the position where NodeInstance will be placed in the [main window], a node is
created, and quick dialog appears.
3. Enter the node instance name at the quick dialog and press [Enter] key.

4. The result is as follows.

Procedure for adding attribute link to node instance

There are two way to add attribute link to node instance.

• using NodeInstance model in the [main window] or the [model explorer]


• using [collection editor]

In the case of using NodeInstance model

1. Select NodeInstance in the [main window] or in the [model explorer],

3rd Semester UET TAXILA


2. Right-click the selected NodeInstance, select [Add] -> [Attribute Link] popup menu,
and you can add Attribute Link.

3. The node doesn't show attribute link on the view.

In the other case

1. Select [Collection Editor...] popup menu of NodeInstance.

2. Or click button in [Slots] property on properties window.

3rd Semester UET TAXILA


3. At [Slots] tab of the [collection editor], you can add attribute link by using button.

Artifact:
An Artifact represents a physical piece of information that is used or produced by a software
development process. Examples of Artifacts include models, source files, scripts, and binary
executable files. An Artifact may constitute the implementation of a deployable component.

Procedure for creating artifact

To create Artifact,

1. Click [Toolbox] -> [Deployment] -> [Artifact] button.

2. Click at the position where Artifact will be placed in the [main window].
3. At the quick dialog, enter the artifact name and press [Enter] key.
4. The result is as follows.

3rd Semester UET TAXILA


Association:
Procedure for creating association

To create association,

1. Click [Toolbox] -> [Deployment] -> [Association] button.

2. Drag from one associated and drop to another in the [main window].

3. The result is as follows.

Dependency:
Procedure for creating dependency

To create dependency,

1. Click [Toolbox] -> [Deployment] -> [Dependency] button.

3rd Semester UET TAXILA


2. Drag and drop between elements in the [main window] in depending direction.

3. Then dependency between two elements is created as follows.

Link:
Procedure for creating link

In order to create Link,

1. Click [Toolbox] -> [Deployment] -> [Link] button.

2. Drag from one NodeInstance and drop to the other NodeInstance in the [main window].

3. Then the link between two node instances is created.

3rd Semester UET TAXILA


Lab Task Marks: 10

Draw a Deployment Diagram for Course Registration System:


• Create a new Deployment diagram with name “CRS-Deployment”.
• Create three Nodes: “Client PC running Browser”, “WebServer”, “DBServer”.
• Create communication path: ClientPC - WebServer and WebServer - DBServer
• Create an artifact “CourseRegistrationSystemUI” inside “Browser” Execution
Environment and <<deploy>> the artifact on Client PC node.
• Create an artifact “CourseRegistrationSystemWebsite” and <<deploy>> the artifact to
“WebServer” node.
• Create an artifact “CourseRegistrationSystemDB” and <<deploy>> the artifact to
“DBServer” node.

*****************

3rd Semester UET TAXILA

You might also like