Defines interfaces for components that can be loaded and initialized at run time by generic application repository factory.

Package Specification

To decouple application business code from specific implementations of service components a some sort of generic application repository factory is needed. The job of the factory is to serve by name instances that implement specific service interfaces. Once instantiated service implementation objects need to initialize themselves before they are ready to serve client requests. This package defines contracts between the generic application repository factory and service implementations that support run time loading and initialization.

Use example

// Possible implementation of generic application repository factory
public class Repository
{
  public static Object get(Class oServiceInterface, String strServiceName)
  {
    ...

    strClass = getImplementationClassName(oServiceInterface, strServiceName);

    IService oRealServer = (IService) Class.forName(strClass).newInstance();

    oRealServer.initialize(strServiceName);

    ...

    return oRealServer;
  }
}

// Possible use of generic application repository factory to get configuration service
 ...

IConfig oConfig = (IConfig) Repository.get(IConfig.class, "myConfigName");

String  strMyValue = oConfig.getString("myStringParameterName");

...

@since 12/15/2004