Week 2
Week 2
Here, the notion of a component as a modular unit that can be used by other
modular units harks back to the pre-CBD days of modular software development.
In those days, composition was predominantly viewed as linking software units
that are parametrised structures such as modules (see Chapter 3), and units were
combined via usage links and parameters, the latter constituting their interfaces. In
contrast, in CBD composition is not limited to linking modules (again see Chapter
3), since there are other kinds of components than modules.
15
16 An Introduction to Component-Based Software Development
Apart from the aforementioned component definitions, there are many others.
From all these definitions, a generally accepted view of a software component
has emerged: it is a software unit with provided services and required services
(Fig. 2.1). The provided services (represented by lollipops) are operations per-
formed by the component. The required services (represented by sockets) are the
What are Software Components? 17
and ‘deposit’, and passes the customer request on to the Bank component. The
bank component provides the service (withdraw or deposit) that the customer has
requested, by passing these requests on to the Account component, which provides
these services.
There are three main types of components that are currently used in practice: (i)
objects (Fig. 2.4(a)), as in object-oriented programming; (ii) architectural units
(Fig. 2.4(b)), as in software architectures [Shaw and Garlan (1996); Bass et al.
(2012)]; and (iii) encapsulated components (Fig. 2.4(c)), as in components with
no external dependencies.
in1 out1
Provided in2 out2
method
(a) An object (b) An architectural unit (c) An encapsulated component
Fig. 2.4 The three main types of components that are currently used in practice.
Doug McIlroy [McIlroy (1968)] is credited with introducing the notion of software
components. In fact he promulgated mass produced software components, even
product lines (or families of related products). He considered components to be
routines (or procedures) that can be used together in building a system. He also
described components as modules, interchangeable parts and black boxes.
In [Cox (1986)], Cox defined software integrated circuits as components in
object-oriented software development. These software units with pins or plugs as
in silicon chips are of course a form of architectural units.
An extensive discussion about what components are, or should be, can be
found in [Broy et al. (1998)], which lists definitions offered by many contrib-
utors. Definitions include: ‘a group of related classes’, ‘data capsule’, ‘binary
unit’, ‘self-contained entity’. The discussion in this book provides the widely ac-
cepted desiderata for CBD that underpin the idealised component life cycle (see
Section 1.1).