Skip to main content

Deployment diagram as class diagram of nodes

Short answer

A deployment diagram is a special class diagram where nodes (hardware/execution environments) act as classifiers with attributes, operations, instances, and relationships (associations, dependencies, generalization). It uses same notation (rectangles, stereotypes, multiplicities) but focuses on physical runtime mapping of artifacts to nodes and communication paths instead of logical software classes.

In many ways, a deployment diagram is just a special kind of class diagram, which focuses on a system's nodes. Justify this statement.

A deployment diagram shows the physical architecture of a system at run time: the nodes (hardware devices or execution environments), the artifacts (executables, libraries, files, databases) that are deployed on them, and the communication paths between nodes.

Why it is a special kind of class diagram

  1. Nodes are classifiers. Like classes, nodes have a name, can have attributes (memory, processor speed) and operations/services, and can be instantiated: "node type" and "node instance" parallel "class" and "object".
  2. Same kind of relationships. Nodes are connected with associations (communication paths such as <<TCP/IP>>), with multiplicity, and can be related by dependency, aggregation (a node containing nodes) and generalization (a Server node specialised into WebServer, DBServer).
  3. Same notation rules. Rectangles (3D boxes), stereotypes <<device>>, <<execution environment>>, names, compartments, multiplicities, and notes are used just as in a class diagram.
  4. Focus is changed. Instead of the logical classes of the software, the focus is on the physical elements of the system: the nodes on which components run.
   +------------------+         +-------------------+
  /| <<device>>      /|  TCP/IP | <<device>>       /|
 / | Client PC      / |---------| Application Srv / |
+--+---------------+  |  1    * +-----------------+ |
| browser          |  |         | order.war       | |
+------------------+--+         +--------+--------+-+
                                         | JDBC
                                 +-------+---------+
                                 | <<device>> DB   |
                                 | orders.mdb      |
                                 +-----------------+

Hence a deployment diagram is a class diagram whose "classes" are nodes, with associations between nodes, and with artifacts placed inside them, to show how software is mapped to hardware.

✓ Answer checked by Claude Sonnet 5.5

All Object Oriented Analysis and Design chapter 3 questions →