Chapter 5
Implementation View
                             UML Diagrams
                                                                       Behavioural View
                  Structural View                                    - Sequence Diagram
                  - Class Diagram                                 - Collaboration Diagram
                 - Object Diagram                                   - State-chart Diagram
                                                                       - Activity Diagram
                                          User’s View
                                           -Use Case
                                            Diagram
              Implementation View
             - Component Diagram                                    Environmental View
                                                                  - Deployment Diagram
Diagrams and views in UML
11/21/2023 8:56 PM                  Dr. Dipankar Dutta, UIT, BU                             6.2
                     Component Diagram cont…
 So far diagrams deals with conceptual entities.
       – Class diagram represent a concept: an abstraction of item that
         fit into this category.
       – State diagram represent a concept: changes in the state of
         object.
 Component diagrams deals with separate types of entities:
     a software component.
11/21/2023 8:56 PM         Dr. Dipankar Dutta, UIT, BU                6.3
                     Component Diagram cont…
 It is an Implementation diagrams.
        Describe the different elements required for implementing a
           system
 It is a Structure diagrams.
        A type of diagram that depicts the elements of a specification
           that are irrespective of time.
11/21/2023 8:56 PM            Dr. Dipankar Dutta, UIT, BU             6.4
                     Software Component
 It is a modular part of a system.
       – A component resides in a computer and not in the mind of the
         analyst.
       – A component provides interfaces to other components.
 A component is an autonomous unit within a system.
11/21/2023 8:56 PM        Dr. Dipankar Dutta, UIT, BU               6.5
                        Component
 The components can be used to define software systems of
    arbitrary size and complexity
 UML component diagrams enable to model the high-level
    software components, and the interfaces to those components
 Important for component-based development (CBD)
 Component and subsystems can be flexibly REUSED and
    REPLACED
 11/21/2023 8:56 PM        Dr. Dipankar Dutta, UIT, BU            6.6
                         Component
 A dependency exists between two elements if changes to the
     definition of one element may cause changes to the other.
 Component Diagrams are often referred to as “wiring diagrams”.
 The wiring of components can be represented on diagrams by
     means of components and dependencies between them.
11/21/2023 8:56 PM        Dr. Dipankar Dutta, UIT, BU              6.7
                            Types
 Deployment components
 Work product components
 Execution components
11/21/2023 8:56 PM   Dr. Dipankar Dutta, UIT, BU   6.8
                     Component in UML 2.0
 Modular unit with well-defined interfaces that is replaceable
     within its environment
 Autonomous unit within a system
        Has one or more provided and required interfaces
        Its internals are hidden and inaccessible
        A component is encapsulated
        Its dependencies are designed such that it can be treated as
           independently as possible
11/21/2023 8:56 PM          Dr. Dipankar Dutta, UIT, BU             6.9
                        Case Study
 Development of an application collecting students’ opinions
    about courses
   A student can
      Read
      Insert
      Update
      Make data permanent about the courses in its schedule
   A professor can only see statistic elaboration of the data
   The student application must be installed in pc client (sw1,
    sw2)
   The manager application must be installed in pc client (in the
    manager’s office)
   There is one or more servers with DataBase and components
    for courses management
 11/21/2023 8:56 PM      Dr. Dipankar Dutta, UIT, BU                 6.10
                      Component notation
 A component is a subtype of Class which provides for a Component
    having attributes and operations
 Being able to participate in Associations and Generalizations
 A Component may form the abstraction for a set of realizing Classifiers
  that realize its behavior
 A Component may optionally have an internal structure and own a set
  of Ports that formalize its interaction points
 11/21/2023 8:56 PM          Dr. Dipankar Dutta, UIT, BU                    6.11
                      Component elements
 A component can have
       Interfaces
         An interface represents a declaration of a set of operations
           and obligations
       Usage dependencies
         A usage dependency is relationship which one element
           requires another element for its full implementation
       Ports
         Port represents an interaction point between a component
           and its environment
       Connectors
         Connect two components
         Connect the external contract of a component to the
           internal structure
 11/21/2023 8:56 PM        Dr. Dipankar Dutta, UIT, BU                  6.12
                             Interface
 An interface is a kind of classifier that represents a declaration
  of a set of coherent public features and obligations
 An interface specifies a contract; any instance of a classifier that
  realizes the interface must fulfill that contract.
 The obligations that may be associated with an interface are in
  the form of various kinds of constraints (such as pre- and post-
  conditions) or protocol specifications, which may impose
  ordering restrictions on interactions through the interface
 11/21/2023 8:56 PM       Dr. Dipankar Dutta, UIT, BU                    6.13
                               Interface
 A component defines its behaviour in terms of provided and
    required interfaces
 An interface
       Is the definition of a collection of one or more operations
       Provides only the operations but not the implementation
       Implementation is normally provided by a class/ component
       In complex systems, the physical implementation is provided by a
        group of classes rather than a single class
 11/21/2023 8:56 PM           Dr. Dipankar Dutta, UIT, BU                  6.14
                     Types of Interfaces
 Provided
 Required
11/21/2023 8:56 PM       Dr. Dipankar Dutta, UIT, BU   6.15
                     Provided Interface
 Characterize       services      that       the        component   offers   to   its
     environment
 Is modeled using a ball, labelled with the name, attached by a
     solid line to the component
11/21/2023 8:56 PM         Dr. Dipankar Dutta, UIT, BU                              6.16
Component has provided Port (typed by
            Interface)
 Ports represent interaction points between a component and its
     environment
 The interfaces associated with a port specify the nature of the
     interactions that may occur over a port.
 The provided interfaces of a port characterize requests to the
     component that its environment may make through this port.
11/21/2023 8:56 PM        Dr. Dipankar Dutta, UIT, BU             6.17
                     Required Interface
 Characterize services that the component expects from its
     environment
 Is modeled using a socket, labelled with the name, attached by a
     solid line to the component
 In UML 1.x were modeled using a dashed arrow
11/21/2023 8:56 PM        Dr. Dipankar Dutta, UIT, BU           6.18
                      Component uses Interface
 The required interfaces of a port characterize the requests
    which may be made from the component to its environment
    through this port.
 11/21/2023 8:56 PM          Dr. Dipankar Dutta, UIT, BU        6.19
                          Interface
 Where two components/classes provide and require the same
    interface, these two notations may be combined.
 The ball-and-socket notation hint at that interface in question
    serves to mediate interactions between the two components
 11/21/2023 8:56 PM       Dr. Dipankar Dutta, UIT, BU               6.20
                                    Port
 Specifies a distinct interaction point
        Between that component and its environment
        Between that component and its internal parts
11/21/2023 8:56 PM        Dr. Dipankar Dutta, UIT, BU    6.21
                                 Port
 Is shown as a small square symbol
 Ports can be named, and the name is placed near the square
  symbol
 Is associated with the interfaces that specify the nature of the
  interactions that may occur over a port
11/21/2023 8:56 PM     Dr. Dipankar Dutta, UIT, BU              6.22
                                 Port
 Ports can support unidirectional communication or bi-directional
     communication
11/21/2023 8:56 PM     Dr. Dipankar Dutta, UIT, BU              6.23
                                   Port
 If there are multiple interfaces associated with a port, these
     interfaces may be listed with the interface icon, separated by a
     commas
11/21/2023 8:56 PM       Dr. Dipankar Dutta, UIT, BU               6.24
                                      Port
 All interactions of a component with its environment are achieved
     through a port
 The internals are fully isolated from the environment
 This allows such a component to be used in any context that
     satisfies the constraints specified by its ports
 Ports are not defined in UML 1.x
11/21/2023 8:56 PM          Dr. Dipankar Dutta, UIT, BU          6.25
                      Assembly connector
 An assembly connector is a connector between two components
    that defines that one component provides the services that
    another component requires.
 An assembly connector is a connector that is defined from a
    required interface or port to a provided interface or port
 11/21/2023 8:56 PM         Dr. Dipankar Dutta, UIT, BU          6.26
                     Sample interfaces
11/21/2023 8:56 PM      Dr. Dipankar Dutta, UIT, BU   6.27
              Example Component Diagram
11/21/2023 8:56 PM   Dr. Dipankar Dutta, UIT, BU   6.28
                     Component Diagram
11/21/2023 8:56 PM       Dr. Dipankar Dutta, UIT, BU   6.29
                     Common Stereotypes
11/21/2023 8:56 PM       Dr. Dipankar Dutta, UIT, BU   6.30
       The example shows the internal
      components of a larger component
11/21/2023 8:56 PM   Dr. Dipankar Dutta, UIT, BU   6.31
                     Component Diagram
11/21/2023 8:56 PM       Dr. Dipankar Dutta, UIT, BU   6.32
Thank you
Questions?