Title

Page 404

Introduction

Component A component is a n encapsulated part of a software system. A component has a n interface. Components serve a s the building blocks for the structure of a system. At a programming-language level, components may be represented a s modules, classes, objects or a set of related functions.

The following figure shows three different components: Cla-9 Random

IEFINITION MODULE CoreData;

I

private: int s e e a ; i n t seeds;

7ROH S y s IMPORT

objrupe. ObjID;

public:

Random l i n t aeedi ; -Randarn I I ; i n t random-cardlint m a x i ;

EXPORT QUALIFIED PRCCEDURE newobj 0 :ObjType; PROCEDURE loadobj l1D:objIO) :ObjVpe; PROCEDURE storeobj 1obj:objTypei ; END CoreData.

MODULA4 definition

module

C++ class definitlon

C functions

Note that components can be of very different natures. In the Broker pattern (99), for example, we mention 'the Broker component'. Depending on the implementation of this pattern, the Broker component can be a linked library or a separate process. The term 'component' is-at least at first sight-independent of its eventual manifestation in source code. We sometimes use the term 'component' even more loosely. For example, when we speak of the 'client component', we intentionally want to forget for the moment how the client will be implemented. We want instead to focus on a different problem, for example that of specifying how clients can exploit the services that a pattern offers.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.