user2627331
user2627331

Reputation: 43

Associations between components in UML Component Diagrams

Suppose that I am designing a distributed application:

It is composed by one host, that is the frontend web service of the company (CompanyWS), and one or more hosts, say three, that are the distributed warehouses of the company. Each warehouse is a web service (WarehouseWS) and provides one interface, for instance IWarehouse.

Well, because a UML component

[...]represents a modular part of a system, that encapsulates its content and whose manifestation is replaceable within its environment. A component defines its behavior in terms of provided and required interfaces

the web services can be seen as components.

In a UML Component Diagram how can I express the semantic that the CompanyWS can be plugged to one or more WarehouseWS? Is an association between the components the right way?

Link to what has been done-Component Diagram

Upvotes: 3

Views: 1305

Answers (1)

thommy
thommy

Reputation: 73

In the UML 2.4.1 Specification it is possible to use ports with multiplicity between components. See page 188, OMG Unified Modeling LanguageTM (OMG UML), Superstructure, Version 2.4.1

So you could define the Warehouse Port (wp) with cardinality [0..1] and the provided interface IWarehouse on component WareHouseWS. On the Component CompanyWS you define the Company Port (cp) with cardinality [0..*] and the required interface IWareHouse.

wp : IWarehouse [0..1]

cp : IWareHouse [0..*]

Upvotes: 2

Related Questions