0% found this document useful (0 votes)
18 views23 pages

1942-Module 08 PPT

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views23 pages

1942-Module 08 PPT

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Object Oriented Analysis and Design

Chapter 8

Component and Deployment Diagrams


Learning outcome

At the end of this chapter, you will be able to:

• Understand component diagrams

• Identify components in UML 1.x and UML 2.0

• Understand the concept of deployment diagrams

2
Component Diagrams
• A software component is a modelled part of a system. Because it includes the software
implementation of one or more classes and a component resides in a computer. A component can
only provide interfaces to other components .
• In UML 1.x, tables, data files, executable, dynamic link libraries and documents are defined as
components.
• The modelers that are used to classify these types are known as deployment components,
execution components and work product components.
• A component defines a system’s functionality. Just like a component is the implementation of one
or more classes, an artefact is the implementation of a component.
• The components and their relationships can be modelled so that clients could picture the
structure and the functionality in the completed project developers have the foundation
structure to work upon technical writers providing documentation and help files can
understand the content of their writings.
• Developers are ready for reuse.

3
Components and Interfaces
• Along with components, their interfaces also have to be dealt with.
• An object hides its functions from other objects and from the outside world. This process is
referred as encapsulation or information-hiding.
• The object has to present some information to its users. This presentation is called the object’s
interface.

• Reviewing Interfaces
1. An interface is a set of operations that allows the user to access a class’s behavior like the control knob, which enables
the user to get a washing machine to the working state. In all, the interface is a set of operations that a class presents to
other classes.
2. An interface can be conceptual or physical in nature. The interface that a class uses is same as the interface, a
component uses.

• Replacement and Reuse


1. The component can be replaced with another if the new components accept the same interfaces as the old one.
2. A component can be reused in another system if the new system could access the reused component from the
component interfaces. When the component interfaces are refined, a wide array of other components can also access them.
The same component can be engineered to be reused through the system program.
4
• Representing a Component in UML 1.x and UML 2.0
• In UML 1.x, the prime icon of the component diagram is a rectangle with two rectangles overlaid
on its left side. Many modelers found the 1.x symbol too bulky, when they had to show a
connection on the left side. Hence, UML 2.0 has made available a new component icon. In UML
2.0, the icon is a rectangle in shape with the keyword
«component» at the top.

5
<<Component>>

tools::Calculator

Calculator
<<Component>> <<Component>>
Calculator Calculator

add()

subtract()

multiply()
Component icon divide()

Adding information to component icon

6
Representing Interfaces
• A component and the interfaces it understand can be presented in two ways.
• The first defines the interface as a rectangle that contains interface-related information.
• It is interlinked to the component through a dashed line as well as a large open triangle that
indicate realization.

<<Interface>>
Key

<<Component>>

Calculator
state Changed()

7
Representing Interfaces

Key
<<Component>>

Calculator

8
Two way of showing dependency and realization in the same
diagram

<<Interface>>
Key
<<Component>> <<component>>
Robot

Calculator
state Changed()

9
Two way of showing dependency and realization in the same
diagram

<<component>>
<<Component>> Robot

Calculator

10
Boxes—Black and White

• When component interfaces gets modelled as depicted in figure 8.6, the user
could show what UML calls an external, or “black box,” view.
• An internal, or “white box,” view can also be shown.
• This view defines interfaces mentioned inside the component icon and
organized by keywords. Figure below depicts a white box view of the
components in figure.

<<Component>> Robot

<<required interface>> Key

11
Applying Component Diagrams

• The Java code generates an application called


ColourSlide.
• It is a set of three sliders, which enables the user to
mix amounts of green, red and blue and form a
color. One slider responds to each of the mixed
colors.
• The position of each slider determines the proportion
of its color that goes into the mix.
• The newly created color gets displayed in a panel
just below the sliders.
• The positions of the sliders in the figure below
formed North Texas Mean Green color.

12
Deployment Diagram
• The packages that supply the Java elements
being used in the program.
• In the diagram , awt means “abstract
windowing toolkit,” a group of components
which display and control a graphic user
interface.
• The components used for this program are
Color that displays the color, Grid Layout
and Flow Layout that arrange the elements in
the GUI and Graphics and Graphics2D that
paint the GUI
• The name specified on the tab of the other major
package, swings, is a group of components that
the user could add to a graphic user interface.
• The names given to the components in the
package in the above diagram are quite self-
explanatory. JFrame is a frame, JSlider is a
slider, JPanel is a panel and JLabel is a label.
The package that is labelled as swing. Event,
makes the Change Listener interface available.
• This interface awaits the change in the state to 13
happen in the GUI.
Deployment Diagrams in the Big Picture

14
Communication Diagram

• A communication diagram defines the


interaction of objects through
messages.

• The communication diagrams are


more useful when the links are more
important for the development
process.

15
Deployment Diagram
• A deployment diagram defines the method in which artefacts are
deployed on system hardware, and the way in which pieces of
hardware connect to one another.
• The important hardware item in this case, is a node. Node is a
generic name for a computing resource.
• In UML 1.x, most of the modelers have distinguished between
two kinds of nodes viz., a processor, which executes a
component and a device that is a peripheral piece of hardware,
which does not execute components but interfaces indirectly with
the outside world.
• UML 2.0 defines a device as a node that executes artefacts. In
UML 2.0, a node is represented by a cube.
• A name is designated for the node, and the keyword «Device» is
added.

16
Three ways to model the artefacts deployed on
a node

17
Representing the connection between nodes
• A line that joins two cubes signifies a
connection between two nodes.

• The connection need not be in the form


of physical wire.

• They can even be represented as


wireless connections like satellite and
infrared.

18
Representing a deployment specification

• UML 2.0 emphasizes more on artefacts.

• This has brought a set of new artefact-related concepts.

• The deployment specification is one such concept.

• It is an artefact, which provides the parameters for another


artefact.

• The initialization commands that some modem connections


require can be considered as a good example to explain the
concept. It includes a string of characters, which sets values for
certain characteristics of the modem.

• Fig demonstrates the modelling of a deployment specification.

19
Modelling a home system

• While modelling a home system, the devices and the node symbols are used to represent peripherals. In UML 2.0, a node
represents a piece of hardware, which can compute.

• Since the systems involve peripherals, peripherals also have to be included in models.

• While distinguishing peripherals from devices, «peripheral» has to be added to every non normative node. The non normative
node’s name can itself supply all the information about the node.

• The broadband connection is modelled with internet service provider.

• The cloud represents the internet and the lightning bolt represents a wireless connection.

20
21
Summary
• A communication diagram defines the interaction of objects through messages. The communication diagrams
are more useful when the links are more important for the development process.
• A sequence diagram is meant for creating the sequence of the messages. The sequence diagrams are used
when the sequence of calls is needed for the development.
Components diagrams are kind of the diagrams that depict the physical architecture of the system software.
Components diagram helps in demonstrating the method in which the programming code is divided into various
components as well as the dependencies between those components.
• A deployment diagram defines the method in which artifacts are deployed on system hardware, and the way in
which pieces of hardware connect to one another.

22
Thank You

23

You might also like