Component Diagrams
Component Diagrams
Component Diagrams
Diagrams
This document is for private circulation only,
For Final Year BTech. Computer 2022-23 CCOEW students.
• Just as with classes, you may draw components adorned with tagged
values or with additional compartments to expose their details.
Components and Classes
In many ways, components are like classes:
Stereotype Semantics
•Like all other diagrams , component diagram may contain notes &
constraints.
•Ports may specify inputs and outputs as they can operate bi-directionally.
Ports can support unidirectional communication or bi-directional
communication.
•Ports can be named, such as the Security and Data ports on the Student
component.
•The following diagram details a component with a port for online
services along with two provided interfaces order entry and tracking as
well as a required interface payment
The diagram above demonstrates some components and their inter-relationships.
Assembly connectors "link" the provided interfaces supplied by "Product" and "Customer"
to the required interfaces specified by "Order". A dependency relationship maps a
customer's associated account details to the required interface; "Payment", indicated by
"Order
19.13
Using interfaces
• Advantages:
– When we design with classes, we are designing to specific
implementations
– When we design with interfaces, we are instead designing to
contracts which may be realised by many different
implementations (classes)
– Designing to contracts frees our model from implementation
dependencies and thereby increases its flexibility and extensibility
• Disadvantages:
– Interfaces can add flexibility to systems BUT flexibility may lead to
complexity
– Too many interfaces can make a system too flexible!
– Too many interfaces can make a system hard to understand
Keep it simple!
25
19.14
26
Online Shopping