Framework Instantiation
The process of transforming a framework into a concrete application is called instantiation.
Instantiation Approach for
the Real Time Java Framework
At its most basic level, framework instantiation requires two tasks:
- creation of components that are required by a specific application
- configuration of application components
The framework proposes a set of component factories to perform the creation
process and part of the configuration process for the framework
core components. The construction and configuration of application-specific
components must be done in dedicated factories
that are provided by the application developer and that extend the framework
factories. Additionally, the framework provides a configuration
class that defines all the constants required for the configuration of the
framework core components. The application developer should define a similar
configuration file to hold the application-specific configuration constants.
The actual configuration process should be carried out by a Instantiator
class. This class cannot be pre-defined by the framework but the framework
provides a sample instantiator class
Back To Top, Back
to Real-Time Java Project Home
Instantiation Factories
An instantiation factory is a component that is responsible for creating
and configuring a set of components. Two types of instantiation factories are
foreseen for the framework instantiation process:
- The framework factories
- The application-specific factories
The framework factories create and configure the core components of
the framework. They are therefore application-independent and are provided by
the framework itself. The framework factories can be realized as abstract
classes. They always provide full implementation of methods to create and
configure the framework core components. Additionally, they may declare abstract
methods to create application-specific components. These methods are useful to
guide the development of the application-specific factories on the part of the
application-developers.
The application-specific factories create and configure the
application-specific components of an application. They must therefore be
provided by the application developer. They should be obtained by extending the
framework factories. At a minimum, they should provided implementations for the
abstract methods declared by the framework factories. Normally, they will also
provide additional methods to construct components whose type cannot be
anticipated at framework level.
The implementation of the factories is informed by the following principles:
- The methods that create components are called make<component
name>
- Factories are independent of each other
- As far as possible, factories should create and configure
components. Sometimes however, configuration must be deferred because a
component created by factory A needs to be configured with a component from
factory B. This type of configuration is performed by the instantiator
component.
- As far as possible, factory methods should return components with generic
framework types.
The framework defines 11 framework factories. Their classes are gathered
together in a dedicated factories package.
Back To Top, Back
to Real-Time Java Project Home
Configuration Data
The instantiation of an application requires, among other things, the definition
of the value of a number configuration variables (e.g. the maximum number of
listeners for each event source, the number of operational modes for each
mode-dependent component, etc). Some of these configuration data must be defined
for all applications instantiated from the framework (e.g. the number of modes
of the failure detection manager), others are instead specific to an application
(e.g. the configuration parameters for specific failure recovery actions).
The framework defines a configuration class called FrameworkConfiguration
that defines the configuration data and that can be edited by developers when
they wish to instantiate a particular application. Application developers should
additionally define a similar class with a name like <projectName>Configuration
to hold their application-specific configuration data.
The class FrameworkConfiguration is included
in the factories package.
Back To Top, Back
to Real-Time Java Project Home
Instantiator Component
The instantiator component is responsible for instantiating the framework. More
specifically, it serves two purposes:
- it instantiates the concrete framework factories
- it calls the creation and configuration methods defined by the concrete
framework factories
- sometimes, a component cannot be completely configured within a factory
because its configuration requires access to components that are created in
other factories. The instantiator component performs this type of
cross-factory configuration actions
The configuration component is entirely application specific. It should
however define one method doInstantiation to
instantiate the framework and a series of getter methods to return the framework
factories. These methods are typically used by the application bootstrap code to
have access to the application active components and to pass their entry points
to the application RTOS.
Back To Top, Back
to Real-Time Java Project Home
Last updated on Feb. 20-th 2002 by Alessandro
Pasetti