Unit 8-Component-Diagram Model
Unit 8-Component-Diagram Model
<<Interface>>
Name
methods
• A provided interface is the one that is either
• realized directly by the component itself, or
• realized by one of the classifiers realizing component, or
• is provided by a public port of the component.
• Ball-socket notation is used to show interface
• The provided interfaces of a port describe requests to the
classifier that other classifiers may make through this port.
The required interfaces of a port describe the requests that
may be made from the classifier to its environment through
the port. Weather Services component provides
(implements)
Weather Forecast interface
• A required interface is either
• designated by usage dependency from the component itself,
or
• designated by usage dependency from one of the classifiers
realizing component, or
• is required by a public port of the component.
A provided interface may be shown using the "lollipop" notation attached to the port. A
required interface may be shown using the "socket" notation attached to the port.
Relationship
• Relation/Association: Similar to the
relation/association used in class diagrams
(dependency) (Realization)
Uses of Component diagram
• Modeling Source Code: In application, we organize the files
into larger groups. Sometimes we update some files or
create new version of file. Component diagrams help to
visualize these source code files and their relationships.
• Modeling Executable releases: Releasing a simple
application is easy but for complex technologies we need
main executable, libraries, stored procedures.
Component diagrams help to visualize, specify, construct
and document the configuration of executable releases,
consisting the deployment components that form each
release and the relationships among those components.
• Modeling physical databases: Mapping a logical
database schema to a relational database is not so
simple. In presence of inheritance decisions should be
made about how to map classes to tables.
– Define a separate table for each class
– Collapse inheritance lattices so that all instances of
any class in a hierarchy have the same state
– Separate parent and child states into different tables
• Modeling adaptable systems: sometimes due to
complex operations the database is separated on
different servers.
Example: Online shopping system
• WebStore subsystem contains three components related to online shopping -
Search Engine, Shopping Cart, and Authentication. Search Engine component
allows to search or browse items by exposing provided interface Product
Search and uses required interface Search Inventory provided by Inventory
component. Shopping Cart component uses Manage Orders interface provided
by Orders component during checkout. Authentication component allows
customers to create account, login, or logout and binds customer to some
account.
• Accounting subsystem provides two interfaces - Manage Orders and Manage
Customers. Delegation connectors link these external contracts of the
subsystem to the realization of the contracts by Orders and Customers
components.
• Warehouses subsystem provides two interfaces Search Inventory and Manage
Inventory used by other subsystems and wired through dependencies.
Component Diagram for School Admission System