Niclas Hedhman wrote:

On Sunday 30 November 2003 16:59, Stephen McConnell wrote:


Builder builder = new DefaultBuilder( context, artifact );
Factory factory = builder.getFactory();



May I suggest that the Builder and Factory gets a bit more specific names?


Although packages helps the compiler to separate different classes apart, I am not that capable and would like to know the type of the factory as part of its basename.


Both Builder and Factory are completely type neutral. This is specifically to allow the management of factories by a bootstrapping system that does not know about a specific application. More importantly, the generic builder does not have application specific classes in its classpath.


You could write a specialized builder that declares jar dependencies as part of its associated metadata, and in that builder you would be able to cast a factory to a application specific factory.

 SpecialBuilder builder = new SpecialBuilder( context, artifact );
 SpecialFactory factory = builder.getSpecialFactory();

However, I'm focussing more on a generic embeddor that will enable the isolation of appication specifics into a handler that is plugged in dynamically.

For example:

Artifact factory = Artifact.createArtifact( "hedhman", "niclas", "1.0" );
Handler handler = Artifact.createArtifact( "hedhman", "niclas-cli", "1.0" );


 Builder builder = new DefaultBuilder( context, factory, handler );
 builder.getHandler().handle( builder.getFactory());

Inside a handler you would be able to do all of the casting to specilized factories, context objects, whatever - because a handler classloader would be constructed relative to the classloader established for the factory (which is what I will give you the environment you want).

In practical terms this means that the repository-main application can establish a merlin factory (or a Fortress factory or a Niclas factory, or whatever), then establish the embedded context handler (e.g. CLI, web-app, unit-test, jelly-scrip, etc.) - without reference to the application classes. If you take a look at the test case currently under sandbox kernel/test you will see that the only dependency is the repository-main which only includes the repository API, SPI and a few utilities. Everything is constructed from this micro-loader (including the actual repository implementation itself).

How does that sound?

Steve.




Cheers,
Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--


Stephen J. McConnell
mailto:[EMAIL PROTECTED]

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to