Antti said:

> After following the recent discussion on defining a minimal set of core
> interfaces for A5 (which is nice), I tried to gather some of the ideas and
> further simplify the concept.

Good stuff, Antti....comments intersperced below...

> 2. Logger, LogEnabled & Co.
> 
> I wouldn't include these in the core interfaces. Logger is just another
> component that could be acquired through the context. This might also help
> to reduce friction between different projects, as using Avalon wouldn't
> force them to use a specific logging interface.

Absolutely agree.

> 3. Lifecycle

>    suspend() / resume()  (~ stop() / start())
> 
>      The necessity of these is subject to some debate. I suppose, the
>      component could have use for them, but the contract would have to be
>      clear (see below).

One area where stop/start() are very useful is the handling of dependencies 
between different services as they are created/started.  Having a clear 
separation between the creation and start/resume makes dependency 
implementation a bit easier.  You might want to review what JBoss did in this 
regard using their JMX-enabled service dependencies.  It's pretty easy to 
provide a abstract component class  (should the developer wish to use such) 
that provides default implementations for the lifecycle methods (most of which 
do nothing).  The bulk of developers would just override the start()/resume() 
method....and leave the create() one alone.

> This would also give clear semantics to suspend() and resume(). To 
> summarize, here's a crude example:
> 
>    public class MyComponent implements ...
>    {
>        void initialize( Context ctx ) throws AppropriateException
>        {
>             Logger logger = (Logger) ctx.lookup("...");
>             Configuration conf = (Configuration) ctx.lookup("...");
>             serviceHandle = (Handle) ctx.lookup("...");

This doesn't make much sense to me.  Why are the Logging and Configuration 
services returned as 1st class objects, but other services are returned through 
a redirection (Handle)?   It would be more elegant if only one method was 
used consistently (either get the real object or all services are returned as a 
Handle).

My 2 cents worth.
Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


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

Reply via email to