 |
Component-based development (CBD) and object-oriented
development go hand-in-hand, and it is generally recognized that object
technology is the preferred foundation from which to build components.
The Unified Modeling Language (UML) includes a
component diagram that
shows the dependencies among software
components, including the classifiers that
specify them (for example implementation
classes) and the artifacts that implement them;
such as source code files, binary code files,
executable files, scripts and tables.
|
|
Component diagrams, along with
UML
Activity diagrams, are
arguably one of the “forgotten” UML diagrams.
Few books invest much time discussing them, I suspect the primary reason
for this is because most methodologists appear to relegate them to low-level
design diagrams for specifying the configuration of your software.
UML Deployment diagrams are preferred by most modelers for this task, not
only can you define what you intend to deploy you can also indicate where you
intend to deploy it with deployment diagrams, and most programmers prefer to use
their configuration management system to define configurations.
UML Component diagrams become much more useful when used as
architectural-level artifacts, perhaps used to model the logical architecture of
your technical or business/domain infrastructures.
There are guidelines for:
-
Components
-
Interfaces
-
Dependencies and Inheritance
As you can see in Figure 1
UML 2.X
components are modeled as rectangles with either a visual stereotype in the top
left corner or the textual stereotype of <<component>>. Components
realize one or more interfaces, modeled using the lollipop notation in Figure
1, and may have dependencies on other components – as you can see the Persistence
component has a dependency on the Corporate
DB component.
Figure 1. A UML Component 2.x diagram
representing the logical architecture of a simple e-commerce system.
- Use Descriptive Names for Architectural Components
- Use Environment-Specific Naming Conventions for Detailed Design
Components
- Apply Textual Stereotypes to Components Consistently
- Avoid Modeling Data and User Interface Components
- Prefer Lollipop Notation To Indicate Realization of Interfaces By
Components
- Prefer the Left-Hand Side of A Component for Interface Lollipops
- Show Only Relevant Interfaces
Components will have dependencies either on other
components or better yet on the interfaces of other components. As you can see in Figure 1 and Figure
2 dependencies are modeled using a dashed line with an open arrowhead.
- Model Dependencies From Left To Right
- Place Child Components Below Parent Components
- Components Should Only Depend on Interfaces
- Avoid Modeling Compilation Dependencies
 |
|
The Elements of UML 2.0 Style describes a collection
of standards, conventions, and
guidelines
for creating effective
UML diagrams. They are based on sound, proven
software engineering principles that lead to diagrams
that are easier to understand and work with. These
conventions exist as a collection of simple, concise
guidelines that if applied consistently, represent an
important first step in increasing your productivity as
a modeler. This book is oriented towards
intermediate to advanced UML modelers, although there
are numerous examples throughout the book it would not
be a good way to learn the UML (instead, consider
The Object Primer). The book is a brief 188
pages long and is conveniently pocket-sized so it's easy
to carry around. |
 |
|
The Object Primer 3rd Edition: Agile Model Driven
Development with UML 2 is an
important reference book for agile modelers,
describing how to develop 35
types of agile
models including all 13
UML 2 diagrams.
Furthermore, this book describes the techniques
of the
Full Lifecycle Object Oriented Testing
(FLOOT) methodology to give you the fundamental
testing skills which you require to succeed at
agile software development. The book also
shows how to move from your agile models to
source code (Java examples are provided) as well
as how to succeed at implementation techniques
such as
refactoring and
test-driven development
(TDD). The Object Primer also includes a
chapter overviewing the critical database
development techniques (database refactoring,
object/relational mapping,
legacy analysis, and
database access coding) from my award-winning
Agile Database Techniques
book. |
 |
|
Agile Modeling: Effective Practices for Extreme
Programming and the Unified Process is the seminal
book describing how agile software developers approach
modeling and
documentation. It describes principles and
practices which you can tailor into your existing
software process, such as
XP, the
Rational Unified Process (RUP), or the
Agile Unified Process (AUP), to streamline your
modeling and documentation efforts. Modeling and
documentation are important aspects of any software
project, including agile projects, and this book
describes in detail how to
elicit requirements,
architect, and then
design your system in an agile manner. |
|
|
We actively work with clients around the world to
improve their information technology (IT) practices,
typically in the role of mentor/coach, team lead, or trainer. A full
description of what we do, and how to contact us, can be
found at Scott W.
Ambler + Associates.
|