Ooad 6
Ooad 6
Ooad 6
UNIT-VI
Architectural Modelling
Components
Terms and Concepts
A component is a physical and replaceable part of a system that conforms to and provides the
realization of a set of interfaces. Graphically, a component is rendered as a rectangle with
tabs.
Names
A component name must be unique within its enclosing package, Every component must
have a name that distinguishes it from other components. A name is a textual string. That
name alone is known as a simple name; a path name is the component name prefixed by the
name of the package in which that component lives. A component is typically drawn showing
only its name, as in Figure Just as with classes, you may draw components adorned with
tagged values or with additional compartments to expose their details,as you see in the figure.
The first difference is the most important. When modeling a system, deciding if you should
use a class or a component involves a simple decision• if the thing you are modeling lives
directly on a node, use a component; otherwise, use a class.
As Figure indicates, you can show the relationship between a component and its interfaces
in one of two ways.
The first (and most common) style renders the interface in its elided, iconic form. The
component that realizes the interface is connected to the interface using an elided
realization relationship.
The second style renders the interface in its expanded form, perhaps revealing its operations.
The component that realizes the interface is connected to the interface using a full realization
relationship. In both cases, the component that accesses the services of the other component
through the interface is connected to the interface using a dependency relationship.
An interface that a component realizes is called an export interface, meaning an interface that
the component provides as a service to other components. A component may provide many
export interfaces.
The interface that a component uses is called an import interface, meaning an interface that
the component conforms to and so builds on. A component may conform to many import
interfaces.
Binary Replaceability
The basic intent of every component-based operating system facility is to permit the
assembly of systems from binary replaceable parts. This means that you can create a system
out of components and then evolve that system by adding new components and replacing old
ones, without rebuilding the system. Interfaces are the key to making this happen. When you
specify an interface, you can drop into the executable system any component that conforms to
or provides that interface. You can extend the system by making the components provide new
services through other interfaces, which, in turn, other components can discover and use.
These semantics explain the intent behind the definition of components in the UML. A
component is a physical and replaceable part of a system that conforms to and provides the
realization of a set of interfaces.
First, a component is physical. It lives in the world of bits, not concepts.
Second, a component is replaceable. A component is substitutable• it is possible to replace a
component with another that conforms to the same interfaces.
Fourth, as discussed in the previous , a component conforms to and provides the realization
of a set of interfaces.
Kinds of Components
Deployment components: These are the components necessary and sufficient to form an
executable system, such as dynamic libraries (DLLs) and executables (EXEs).
Work product components: These components are essentially the residue of the
development process, consisting of things such as source code files and data files from which
deployment components are created. These components do not directly participate in an
executable system but are the work products of development that are used to create the
executable system.
Organizing Components
You can organize components by grouping them in packages in the same manner in which
you organize classes.
Standard Elements
Deployment
Terms and Concepts
A node is a physical element that exists at run time and represents a computational resource,
generally having at least some memory and, often, processing capability. Graphically, a node
is rendered as a cube.
Names
Every node must have a name that distinguishes it from other nodes. A name is a textual
string. That name alone is known as a simple name; a path name is the node name prefixed
by the name of the package in which that node lives. A node is typically drawn showing only
its name,
Just as with classes, you may draw nodes adorned with tagged values or with additional
compartments to expose their details.
However, there are some significant differences between nodes and components.
1.Components are things that participate in the execution of a system; nodes are things
that execute components.
This first difference is the most important. Simply put, nodes execute components;
components are things that are executed by nodes.
A set of objects or components that are allocated to a node as a group is called a distribution
unit.
Organizing Nodes
You can organize nodes by grouping them in packages in the same manner in which you can
organize classes and components.
You can also organize nodes by specifying dependency, generalization, and association
(including aggregation) relationships among them.
Connections
The most common kind of relationship you'll use among nodes is an association. In this
context, an association represents a physical connection among nodes, such as an Ethernet
connection,a serial line, or a shared bus, as Figure shows. You can even use associations to
model indirect connections, such as a satellite link between distant processors.
Common Properties
A component diagram is just a special kind of diagram and shares the same common
properties as do all other diagrams• a name and graphical contents that are a projection into a
model. What distinguishes a component diagram from all other kinds of diagrams is its
particular content.
Contents
Component diagrams commonly contain
· Components
· Interfaces
· Dependency, generalization, association, and realization relationships
Like all other diagrams, component diagrams may contain notes and constraints.
Component diagrams may also contain packages or subsystems.
Common Uses
You use component diagrams to model the static implementation view of a system. This view
primarily supports the configuration management of a system's parts, made up of components
that can be assembled in various ways to produce a running system.
When you model the static implementation view of a system, you'll typically use component
diagrams in one of four ways.
Some systems are quite static; their components enter the scene, participate in an execution,
and then depart. Other systems are more dynamic, involving mobile agents or components
that migrate for purposes of load balancing and failure recovery.
· Either by forward or reverse engineering, identify the set of source code files of interest
and model them as components stereotyped as files.
· For larger systems, use packages to show groups of source code files.
· Consider exposing a tagged value indicating such information as the version number of
the source code file, its author, and the date it was last changed. Use tools to manage
the value of this tag.
· Model the compilation dependencies among these files using dependencies. Again, use
tools to help generate and manage these dependencies.
· Consider the stereotype of each component in this set. For most systems, you'll find a small
number of different kinds of components (such as executables, libraries, tables, files, and
documents). You can use the UML's extensibility mechanisms to provide visual cues for
these stereotypes.
· For each component in this set, consider its relationship to its neighbors. Most often, this
will involve interfaces that are exported (realized) by certain components and then
imported (used) by others.
1. For simple CRUD (create, read, update, delete) operations, implement them with
standard SQL or ODBC calls.
2. For more-complex behavior (such as business rules), map them to triggers or stored
procedures.
· Select a strategy for mapping these classes to tables. You will also want to consider the
physical distribution of your databases. Your mapping strategy will be affected by the
location in which you want your data to live on your deployed system.
· To visualize, specify, construct, and document your mapping, create a component diagram
that contains components stereotyped as tables.
· Where possible, use tools to help you transform your logical design into a physical design.
· Consider the physical distribution of the components that may migrate from node to node.
You can specify the location of a component instance by marking it with a location tagged
value, which you can then render in a component diagram (although, technically speaking, a
diagram that contains only instances is an object diagram).
· If you want to model the actions that cause a component to migrate, create a corresponding
interaction diagram that contains component instances. You can illustrate a change of
Deployment diagram
Terms and Concepts
A deployment diagram is a diagram that shows the configuration of run time processing
nodes and the components that live on them. Graphically, a deployment diagram is a
collection of vertices and arcs.
Common Properties
A deployment diagram is just a special kind of diagram and shares the same common
properties as all other diagrams• a name and graphical contents that are a projection into a
model. What distinguishes a deployment diagram from all other kinds of diagrams is its
particular content.
Like all other diagrams, deployment diagrams may contain notes and constraints.
Deployment diagrams may also contain components, each of which must live on some node.
Deployment diagrams may also contain packages or subsystems,
Common Uses
You use deployment diagrams to model the static deployment view of a system. This view
primarily addresses the distribution, delivery, and installation of the parts that make up the
physical system.
When you model the static deployment view of a system, you'll typically use deployment
diagrams in one of three ways.
· Identify the devices and nodes that are unique to your system.
· Provide visual cues, especially for unusual devices, by using the UML's extensibility
mechanisms to define system-specific stereotypes with appropriate icons. At the very least,
you'll want to distinguish processors (which contain software components) and devices
(which, at that level of abstraction, don't directly contain software).
· Model the relationships among these processors and devices in a deployment diagram.
Similarly, specify the relationship between the components in your system's implementation
view and the nodes in your system's deployment view.
· As necessary, expand on any intelligent devices by modeling their structure with a more
detailed deployment diagram.
example, Figure shows the hardware for a simple autonomous robot. You'll find one
node (Pentium motherboard) stereotyped as a processor.
· Identify the nodes that represent your system's client and server processors.
· Highlight those devices that are germane to the behavior of your system. For example,
you'll want to model special devices, such as credit card readers, badge readers, and display
devices other than monitors, because their placement in the system's hardware topology are
likely to be architecturally significant.
· Provide visual cues for these processors and devices via stereotyping.
· Identify the system's devices and processors as for simpler client/server systems.
· If you need to reason about the performance of the system's network or the impact of
changes to the network, be sure to model these communication devices to the level of detail
sufficient to make these assessments.
· Pay close attention to logical groupings of nodes, which you can specify by using
packages.
· Model these devices and processors using deployment diagrams. Where possible, use tools
that discover the topology of your system by walking your system's network.
· If you need to focus on the dynamics of your system, introduce use case diagrams to
specify the kinds of behavior you are interested in, and expand on these use cases with
interaction diagrams.