There's two more structural diagrams that I want to
mention before we move to the behavioral ones. The
first one's the component diagram. A component diagram is
a static view of components in a system and of
their relationships. More precisely, a node in a component
diagram represents a component where a component consists of one
or more classes with a well-defined interface. Edges conversely
indicate relationships between the components. You can read this relationship
as component A uses services of component B. And notice that the
component diagrams can be used to represent an architecture, which is
a topic that we will cover extensively in the next mini-course.
So let's illustrate this with an example. So, what I'm representing
here is a component diagram for our example system, the course
management system. And as you can see, it's slightly more complex
than the other diagrams that we saw. But there's really no
need to go through all the steps and all the details.
Important thing is to point out some key aspects of
this diagram. So the first one is that these rectangular
nodes are the nodes in the system, so are my
components. For example, student is a component, schedule is a component,
and so on. And as far as edges are concerned,
I'm representing two kinds of edges. The first kind of dashed
edges which were part of the original uml definition and
indicate use. So an edge, for example, between this compnent and
this compnent indicated that the seminar management uses the
facilities component. More recently, in UML two, a richer representation
was introduced, which is the one that I'm also showing
here. So if we look at this part of the
diagram, you can see this sort of you now,
lollipop socket representation. And in this case, what this represents,
is that a lollipop indicates a provided interface. So an
interface that is provided by the component. So, for example,
this security component provides encryption capabilities. The socket,
conversely, indicates a required interface. So, for example, in
this case, it's saying that the facilities component
is needing access control capabilities, which, by the way,
is provided by the security component. So in
a sense these sockets and lollipop indicate interfaces between
a provider of some of functionality, and the client
of that functionality and you can look at those
as basically APIs. So sets of methods that
provide a given functionality. To give you another
example, if we look at the persistence components
the persistence component provides, unsurprisingly, persistent services. And
those persistent services are required by several other
components in the system. And in turn, the persistent
components relies on the University database component to
provide such services. So, there's the University DB components
provide these sort of low-level database services that are used
by the persistence component To in turn provided services. Last thing
I want to note is that components or relationships can be
annotated, so, for example if we look at the seminar management
and the student administration components you can see that they
are annotated here to indicate that they are user inferfaces. So
that's all I wanted to say on the component diagrams, but
again the key piece of information is that they represent components
in the system where a component consists of one or more classes indicate the
interfaces that these components provide or require.
and describe the interactions between these components.