Requirements
Definitions
Requirements
Using the Framework
- The framework will associate interfaces to a plain Java implementation by registering a
Service.- A service can be registered at runtime in code.
- A service can be registered when the framework initializes itself by having the framework look for specifically named property files.
- The framework will use a
Registryto store services. - The framework will use a
Locatorto generate an instance of the Java class which implements the interface. Configuring the Framework
- The framework can be configured programatically by adding
Services to theRegistry. For instance:ServiceManager services = ServiceManager.getInstance(); services.register(new Service(InterfaceClass.class, ImplementationClass.class)); services.register( new Service(AnotherInterfaceClass.class, AnotherImplementationClass.class)); ... - The framework can be configured using a property file where the key in the property file
is the fully qualified classname of the interface and the value in the property file is the
fully qualified classname of the implementation. For instance:
servicemanager.properties ------------------------- com.company.interfaces.InterfaceClass=com.company.impl.ImplementationClass com.company.interfaces.AnotherInterfaceClass=com.company.impl.AnotherImplementationClass
Extending the Framework
The framework will take an interface name and return a plain Java object (POJO) which implements the interface.
The framework will configure itself with some basic, useful options to begin with, but can be overridden and/or extended.
There are no easy ways to extend the framework right now, but plans are in the works.