Composite Structure Diagrams Examples
Here we provide some examples of UML composite structure diagrams:
- Internal Structure - Bank ATM Composite Structure
- Internal Structure - Tomcat 7 Server Composite Structure
- Collaboration Use as Design Pattern - Observer
Bank ATM Composite Structure
This is an example of UML internal structure diagram which shows composite structure of Bank Automated Teller Machine (ATM).
Bank ATM is typically made up of several devices such as central processor unit (CPU), cryptoprocessor, memory, customer display, function key buttons (usually located near the display), magnetic and/or smartchip card reader, encrypting PIN Pad, customer receipt printer, vault, modem.
Internal structure diagram example - Bank ATM
Vault stores devices and parts which require restricted access, including cash dispensing mechanism, deposit mechanism, several security sensors (e.g. magnetic, thermal, seismic, gas), electronic journal system to maintain system log, etc. Cash dispenser includes several removable cash cartridges and deposit mechanism - removable deposite cartridges.
ATM is usually connected to the bank or interbank network via some modem (e.g. dial-up or ADSL) over a public switched telephone line or a leased line. Network interface card (NIC) could be used as a high-speed alternative in VPN connections.
Tomcat 7 Server Composite Structure
This is an example of UML internal structure diagram which shows simplified composite structure of non clustered Apache Tomcat 7 Server.
A Server element represents Catalina servlet container of Apache Tomcat 7 web server. It is the single outermost element in the conf/server.xml configuration file. Server element could contain optional Global Naming Resources component and one or more Services.
Each Service element is a composition of Executors and Connectors that share a single Engine component. The Engine receives and processes all requests from one or more connectors, and returns the completed response to the connector for its transmission back to the web client. One or more Host elements are nested inside the Engine.
Internal structure example - Apache Tomcat 7 Server
The Host element represents a virtual host, which is an association of a network name for a server (such as "www.mycompany.com") with the particular server on which Tomcat is running. More than one network name could be associated with the same virtual host.
The Context element represents a web application, which runs within a particular virtual host. Each web application is based on a Web Application Archive (WAR) file or a directory containing the corresponding unpacked contents, as described in the Servlet specification. Each context must have a unique context name.
Design Pattern - Observer
Observer pattern is a behavioral software design pattern in which a subject maintains a list of subscribers called observers and notifies them of any state changes usually by calling one of their methods. Once state change notification is received observer can request current state of the subject.
An example of collaboration for Observer design pattern is shown below. Two roles of the collaboration - subject and observer - will be played by instances of classifiers typed by Subject and Observer interfaces. These interfaces can be viewed as a projection of the externally observable features of classifiers playing the roles.
Collaboration example - Observer design pattern
The same collaboration could be shown using alternative notation for properties. Collaboration icon is connected to each of the rectangles denoting interfaces that are types of properties of the collaboration. Each line is labeled by the name of the property (role).
Composite structure example - Observer design pattern
