A UML Composite Structure Diagram shows the internal makeup of a classifier such as a class, component, or interface and how its parts collaborate to deliver the classifier’s behavior.
Instead of listing attributes and operations as a Class Diagram does, it opens the box and shows the pieces inside: parts (properties that reference a Class or Interface), ports (interaction points with the environment), and connectors (the wiring between parts or from a port to a part). Use it when you need to explain how responsibilities are distributed inside a design element, how messages travel through ports, and which internal pieces talk to each other. Introduced with UML 2, this view is especially handy in Sparx Systems Enterprise Architect for modeling internal structure and port‑based interactions on classes, components, and interfaces.
Model provided/required interfaces on ports and wire them with assembly or delegation connectors. You get explicit contracts, cleaner boundaries, and fewer hidden dependencies—useful when teams split work across components.
Open up a class or component and show which parts do what, and how they collaborate. This reduces hand‑off friction and speeds up reviews because everyone can see the responsibilities, not just read them in prose.
Represent sensors, controllers, and drivers as parts, with ports that map to pins or protocol endpoints. It’s easier to reason about signal flow and to show how an external device port is delegated to an internal driver.
Model how an external API port routes requests to validation, logging, and domain services. The diagram highlights coupling points and makes impact analysis straightforward when interfaces change.
Treat widgets as parts with event/command ports, then connect them to view models or controllers. This makes reuse obvious and gives testers clear seams for stubs and mocks.
Get Sparx Systems Enterprise Architect and begin creating powerful UML package diagrams with ease. Buy EA Now!
| UML Element Type | Icon in EA Toolbox | Description |
|---|---|---|
| Class |
|
Defines a type with state and behavior. In Composite Structure, a class can be a structured/encapsulated classifier that owns parts and ports. |
| Interface |
|
A contract of operations or signals. In diagrams, ports show provided (lollipop) and required (socket) interfaces. |
| Part |
|
A runtime slot inside a classifier, with a Class or Interface as its classifier. |
| Port |
|
An interaction point on a classifier or part. Ports expose provided/required interfaces and route connections via assembly or delegation. |
| Collaboration |
|
A reusable pattern of roles and their connectors that describes how participants work together. |
| Collaboration Use |
|
Applies a Collaboration pattern in a specific classifier and binds roles to concrete parts. |
| Expose Interface |
|
EA shorthand to display the required/supplied interfaces of a Class/Component/Part on Composite or Component diagrams. |
| UML Connector Type | Icon in EA Toolbox | Description |
|---|---|---|
| Connector |
|
A link between parts or ports. It may reference an Association to define its semantics and is used to satisfy required interfaces or convey signals. |
| Assembly |
|
Connects a required interface to a provided interface—typically via ports—so internal parts can talk to each other. |
| Delegate |
|
Routes an external port on the whole classifier to an internal part’s port, exposing internal capability without tight coupling. |
| Role Binding |
|
In a Collaboration Use, maps each role in the pattern to the concrete part/classifier in this classifier. |
| Represents |
|
Indicates a classifier’s internal structure realizes (is based on) a Collaboration. |
| Occurrence |
|
Shows that a classifier is an occurrence/instance of a Collaboration pattern in this context. |
Accelerate your team’s modeling skills with our expert-led UML and Sparx EA training programs.
This UML Composite Structure Diagram Example of an Online Book Store made with Sparx EA shows a Stock classifier modeled as a composite with two internal parts:
An internal connector labeled barcode links BookStock and records. This expresses how each book instance is identified and looked up by the computer system during scans or updates. In other words, the connector models the operational path between physical stock and the record‑keeping component.
Below the composite, the Class Diagram presents the same idea at the type level: Stock is composed of Books (role BookStock, multiplicity [BookCount]) and associated with Computer (role records). The barcode association between Books and Computer is reflected as the internal connector in the composite view. Together, the two diagrams show who owns what (type relationships) and who collaborates at runtime (parts and connectors).
Use the following steps to define a UML Composite Structure Diagram in Sparx Systems Enterprise Architect:
1. Select the Package in the Project Browser where the diagram should be created.
2. Go to Design > Diagram > Add Diagram, or click the Add Diagram icon above the Project Browser.
3. In the Diagram Builder, open the perspective icon, then UML > Structural, and choose Composite Structure.
4. The Composite Structure toolbox opens automatically; or enable it via Start > All Windows > Design > Toolbox.
5. Drag and drop elements such as Class/Component, Part, Port, Interface, Collaboration, and Collaboration Use. Connect with Assembly or Delegation connectors; use Role Binding or Represents when applying collaboration patterns.
6. Save (Ctrl+S) regularly and use Layout tools and element Compartments (Ports, Parts) to keep the diagram readable.
Let our EA consultants help you structure, optimize, and scale your modeling efforts with precision. Talk to an EA Consultant now!
Submit Your Request and We’ll Promptly Send a Payment link or Invoice.