0% found this document useful (0 votes)
4 views

Week 11- Component Dig

Uploaded by

moosaniazi056
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Week 11- Component Dig

Uploaded by

moosaniazi056
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Development View

(Component Diagram)
By: Dr Huma Hayat Khan
Introduction
• Component diagrams are different in terms of nature and
behaviour. Component diagrams are used to model physical
aspects of a system.

• Now the question is what are these physical aspects? Physical


aspects are the elements like executable, libraries, files,
documents, search engines, servers etc.

• Components are used to create useful pieces of code. And the


components are combined to create whole program and they
perform operations, interact with classes and implement
interfaces. However components tend to perform more
complicated tasks then you normally do with the regular class.
Introduction
• When you think about a pizza, there are many
different ingredients that create it.
• Each of these ingredients are separate
components, but they interact and compliment
one another.
• They all exist within the greater system, in this
case, the pizza.
Introduction
• UML component diagrams are concerned with
the components of a system.
• Components are defined as independent,
encapsulated units within a system.
• Each component provides an interface for
other components to interact with it.
• Component diagrams are used to visualize
how a system's pieces interact and what
relationships they have among them.
Introduction
• What sets component diagrams apart from a
lot of other diagrams is that they are about
high-level structure and not about details like
attributes and methods.

• They are purely about components and how


they interact with one another.
The Basis
• A component is drawn as a rectangle with optional compartments
stacked vertically.

• A high-level, abstracted view of a component in UML can be


modeled as just a rectangle with the component's name and the
component stereotype text and/or icon.

• The component stereotype's text is «component»" and the


component stereotype icon is a rectangle with two smaller
rectangles protruding on its left side. Figure shows three different
ways a component can be drawn using the UML specification.
Modeling a component's interfaces (Provided/Required)
• Components must communicate through interfaces.
• The interfaces provided represent the formal contract of services the
component provides to its consumers/clients.
• Figure in next slide shows the component having a second
compartment that denotes what interfaces the component provides
and requires.

• [Note: Even though components are autonomous units they still may
depend on the services provided by other components. Because of
this, documenting a component's required interfaces is useful.]
3 Ways to show the Provided and Required
Interfaces
MODELING A COMPONENT'S RELATIONSHIPS

• When showing a component's relationship with


other components, the lollipop and socket notation
must also include a dependency arrow.

• On a component diagram with lollipops and


sockets, note that the dependency arrow comes out
of the consuming (requiring) socket and its arrow
head connects with the provider's lollipop, as
shown in Figure.
Showing a component's internal structure

• To show a component's inner structure, you


merely draw the component larger than
normal and place the inner parts inside the
name compartment of the encompassing
component.

• Figure show's the Store's component inner


structure.
• Using the example shown in above Figure , the Store component
provides the interface of OrderEntry and requires the interface of
Account.

• The Store component is made up of three components: Order,


Customer, and Product components.

• Notice how the Store's OrderEntry and Account interface symbols


have a square on the edge of the component. This square is called a
port.

• In a simplistic sense, ports provide a way to model how a


component's provided/required interfaces relate to its internal parts.

• The OrderEntry port delegate to the Order component's OrderEntry


interface for processing.

• Also, the internal Customer component's required Account interface


is delegated to the Store component's required Account interface
port.
Example

You might also like