Notes Lecture 21
Notes Lecture 21
Component interfaces
Provides interface
Defines the services that are provided by the component to other components.
This interface, essentially, is the component API. It defines the methods that can be called by
a user of the component.
Requires interface
Defines the services that specifies what services must be made available for the component to
execute as specified.
This does not compromise the independence or deployability of a component because the
requires interface does not define how these services should be provided.
Component models
A component model is a definition of standards for component implementation, documentation
and deployment. Examples of component models are:
CBSE for reuse focuses on component development. Components developed for a specific
application usually have to be generalised to make them reusable. A component is most likely to
be reusable if it associated with a stable domain abstraction (business object). For example, in a
hospital stable domain abstractions are associated with the fundamental purpose - nurses,
patients, treatments, etc.
Component development for reuse
Components for reuse may be specially constructed by generalising existing components.
Component reusability
Should reflect stable domain abstractions;
Should hide state representation;
Should be as independent as possible;
Should publish exceptions through the component interface.
There is a trade-off between reusability and usability
The more general the interface, the greater the reusability but it is then more complex and
hence less usable.
Changes for reusability
Remove application-specific methods.
Change names to make them general.
Add methods to broaden coverage.
Make exception handling consistent.
Add a configuration interface for component adaptation.
Integrate required components to reduce dependencies.
Exception handling
Components should not handle exceptions themselves, because each application will have its
own requirements for exception handling.
Rather, the component should define what exceptions can arise and should publish these as
part of the interface.
In practice, however, there are two problems with this:
Publishing all exceptions leads to bloated interfaces that are harder to understand. This may
put off potential users of the component.
The operation of the component may depend on local exception handling, and changing this
may have serious implications for the functionality of the component.
Generic components may be less space-efficient and may have longer execution times than
their specific equivalents.
Component management
Component management involves deciding how to classify the component so that it can be
discovered, making the component available either in a repository or as a service, maintaining
information about the use of the component and keeping track of different component versions.
A company with a reuse program may carry out some form of component certification before the
component is made available for reuse.
Certification means that someone apart from the developer checks the quality of the
component.
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.
Requirements: Different groups of components will satisfy different requirements.
Validation:
The component specification may not be detailed enough to allow comprehensive tests to be
developed.
Components may have unwanted functionality. How can you test this will not interfere with
your application?
Component validation
Component validation involves developing a set of test cases for a component (or, possibly,
extending test cases supplied with that component) and developing a test harness to run
component tests.
The major problem with component validation is that the component specification may not
be sufficiently detailed to allow you to develop a complete set of component tests.
As well as testing that a component for reuse does what you require, you may also have to check
that the component does not include any malicious code or functionality that you dont need.
Ariane launcher failure validation failure?
In 1996, the 1st test flight of the Ariane 5 rocket ended in disaster when the launcher went out of
control 37 seconds after takeoff.
The problem was due to a reused component from a previous version of the launcher (the Inertial
Navigation System) that failed because assumptions made when that component was
developed did not hold for Ariane 5.
The functionality that failed in this component was not required in Ariane 5.
Component composition
The component postCodeStripper is the adaptor that facilitates the sequential composition of
addressFinder and mapper components.
The Object Constraint Language
The Object Constraint Language (OCL) has been designed to define constraints that are
associated with UML models.
It is based around the notion of pre and post condition specification common to many formal
methods.
Summary
Process Improvement
CMMI
CBSE
CBSE problems
Component models
Middleware support
CBSE processes
CBSE for reuse