Component-Based Software Engineering
Component-Based Software Engineering
Chapter 19
Component-Based Software Engineering
Objectives
• To explain
T l i that
th t CBSE is
i concerned d with
ith developing
d l i standardized
t d di d
components and composing them into applications
• To describe components and component models
• T show
To h principal
i i l activities
ti iti iin CBSE process
• To discuss approaches to component composition and problems that
may arise
• Component-based
C t b d software
ft engineering
i i (CBSE) is
i an approach
h to
t
software development that relies on software reuse.
– Emerged from the failure of object-oriented development to support effective
reuse
– Single object classes are too detailed and specific to reuse.
• CBSE essentials
i l
– Independent components specified by their interfaces
– Component standards to facilitate component integration
– Middleware that provides support for component inter-operability
– Development process that is geared to reuse
• C
Component trustworthiness
hi
– How can a component with no available source code be trusted?
• Component certification
– Who will certify quality of the components?
• Requirements trade-offs
– How do we do trade-off analysis between the features of one component and
another?
• Components
C t provide
id a service
i without
ith t regard
d to
t where
h the
th componentt is
i
executing or what its programming language is.
- A component is an independent executable entity that can be made up of
one or more executable objects.
- The component interface is published and all interactions are through the
published interface.
Szyperski:
A software component is a unit of composition with contractually s
pecified interfaces and explicit context dependencies only. A softwa
re component can be deployed independently and is subject to co
mposition by third-parties.
Characteristics Description
Component standardisation means that a component that is used in a CBSE process has to
Standardized conform to some standardised component model. This model may define component interfaces,
component meta-data
meta data, documentation,
documentation composition and deployment.
deployment
For a component to be composable, all external interactions must take place through publicly
Composable defined interfaces. In addition, it must provide external access to information about itself such
as its methods and attributes.
To be deployable,
deployable a component has to be self
self-contained
contained and must be able to operate as a
stand-alone entity on some component platform that implements the component model. This
Deployable
usually means that the component is a binary component that does not have to be compiled
before it is deployed.
Components have to be fully documented so that potential users of the component can decide
Documented whether or not they meet their needs. The syntax and, ideally, the semantics of all component
interfaces have to be specified.
• P id interface
Provides i f
– Defines the services that are provided by the component to other
components
• Requires
i iinterface
f
– Defines the services that specifies what services must be made available for
the component to execute as specified.
addSensor
e o eSe so
removeSensor
sensorManagement
M t
star tSensor
Data collector stopSensor
sensorData testSensor
initialize
report
li tAll
listAll
• Component model
C d l is
i ad
definition
fi i i off standards
d d ffor component
implementation, documentation and deployment.
– EJB model (Enterprise Java Beans)
– COM+ model (.NET model)
– CORBA component Model
• Component model specifies how interfaces should be defined and the
elements that should be included in the interface definition.
Composition Documentation
Usage Deployment
I t f
Interfaces
information and use
Component model
Konkuk University 281
Middleware Support
• Middl
Middleware provides
id supportt for
f executing
ti components.
t
– Component models are the basis of middleware.
• Component model implementations provide
– Platform services : allow components written according to the model to communicate
– Horizontal services : application-independent services used by different components
• Container
– A set of interfaces used to access the service implementations
– To use services provided by a model
Horizontal services
C
Concurrency Persistence S
Security
it
Platform services
• Components
C t developed
d l d for
f a specific
ifi application
li ti usually
ll h
have tto b
be
generalized to make them reusable.
• A component is most likely to be reusable if it associated with a stable
domain abstraction (business object)
object).
– In a hospital, stable domain abstractions are associated with the fundamental
purpose - nurses, patients, treatments, etc.
• Component reusability
– Should reflect stable domain abstractions
– Should hide state representation
p
– Should be as independent as possible
– Should publish exceptions through the component interface
• The development
Th d l cost off reusable
bl components may be
b higher
hi h than
h the
h
cost of specific equivalents.
• Existing
E i i llegacy systems that
h fulfill
f lfill a useful
f lbbusiness
i ffunction
i can b
be re-
packaged as components for reuse.
– Involve writing a wrapper component that implements provides and requires
i t f
interfaces t access the
to th legacy
l system
t
– Although costly, this can be much less expensive than rewriting the legacy
system.
• When reusing
Wh i components,t it is
i essential
ti l to
t make
k trade-offs
t d ff b
between
t
ideal requirements and the services actually provided by available
components.
– Developing outline requirements
– Searching for components then modifying requirements according to
available functionality
– Searching again to find if there are better components that meet the revised
requirements
Modify requirements
Outline system Identify candidate according to
requirements components discovered
components
Compose
Architectural Identify candidate
components
p to
design components
create system
• T t
Trust
– You need to be able to trust the supplier of a component.
• At best, an un-trusted component may not operate as advertised.
• At worst, it can breach your security.
security
• Requirements
– Different g
groups
p of components
p will satisfyy different requirements.
q
• Validation
– Component
p specification
p mayy not be detailed enough
g to allow
comprehensive tests to be developed.
– Components may have unwanted functionality. How can you test this will not
interfere with your application?
• P
Process off assembling
bli components to create a system
– Involve integrating components with each other and with the component
infrastructure
– Normally
N ll have
h t write
to it ‘glue
‘ l code’
d ’ to
t integrate
i t t components t
• Types of composition
– Sequential composition
• Where the composed components are executed in sequence
• Involves composing the provides interfaces of each component
– Hierarchical composition
• Where one component calls on the services of another.
• The provides interface of one component is composed with the requires interface of
another
– Additive composition
• The interfaces of two components are put together to create a new component
• P
Parameter i
incompatibility
ibili
– Operations have the same name but are of different types.
• Operation incompatibility
– Names of operations in the composed interfaces are different.
• Operation incompleteness
– Provides interface of one component is a subset of the requires interface of another.
• Address the
Add h problem
bl off component iincompatibility
ibili b by reconciling
ili the
h
interfaces of the components that are composed.
– Different types of adaptor are required depending on the type of composition.
sensorManagement addSensor
start
removeSensor
startSensor
stop
sensor Adapter Data collector stopSensor
testSensor
sensorData
getdata iinitialise
i i li
report
listAll
• Have to rely
H l on component documentation
d i to decide
d id if syntactically
i ll
compatible interfaces are actually compatible
-- The context keyword names the component to which the conditions apply
context addItem
context delete
• Wh composing
When i components, you may find
fi d
– Conflicts between functional and non-functional requirements
– Conflicts between the need for rapid delivery and system evolution
Data
(b) Data base
collection
Repor t
Konkuk University 294
Summary
• CBSE is
i a reuse-based
b d approach h to
t defining
d fi i andd implementing
i l ti loosely
l l
coupled components into systems.
• A component is a software unit whose functionality and dependencies
are completely defined by its interfaces.
interfaces
• A component model defines a set of standards that component
providers and composers should follow.
• Component composition is the process of ‘wiring’
wiring components together
to create a system.
• When composing reusable components, you normally have to write
adaptorss to reconcile
adapto eco c e different
d e e t component
co po e t interfaces.
te aces.
• When choosing compositions, you have to consider required functionality,
non-functional requirements and system evolution.