avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: [Proposal] Distilling common Context Attributes
Date Tue, 27 Aug 2002 19:19:54 GMT
Leo Simons wrote:
> On Tue, 2002-08-27 at 18:04, Berin Loritsch wrote:
>>I would like to propose a minimum set of attributes that all containers
>>need to support, which will provide some guarantees for the components
>>that need them.
> +1. IOW, this is an extension of the contract for the Context interface.
> "If a container provides feature X, it must do so using the following
> key and the following value type". Right?


It's a contract, exactly like lifecycle.

BTW, I would propose that a Context should never be cast to a type.
It's bad, because I have no way whatsoever of knowing what I'm getting, 
because it's not defined anywhere.

Casting should be done when getting services; there I know that the key 
is associated with an interface, which must at least be specified in the 
  Container descriptor.

>> So far, I only have three that would fit the bill:
>>1) "context:dir" A java.io.File representing the context directory
>>   to the component.  Sort of a "home" directory.
>>2) "context:scratch" A java.io.File representing the context directory
>>   that the component can use as a hash area--nothing permanent
>>   but useful for dynamic compilation, cache entries, etc.
>>3) "context:classloader" A java.lang.ClassLoader that the component can
>>   use to create objects or child components with.
>>The names are of course up for debate, but the concepts are fairly
> +1. For naming I like postfixing dirs with .dir (I do it in ant
> buildfiles all the time, anyway =).

Me too :-)

> I'd say
> avalon:context.home.dir
> avalon:context.scratch.dir
> avalon:context.classloader
> ^^^ --> to be real clear about the "level of endorsement" here.


  avalon:context.temp.dir (I really don't like "scratch")

> yup. I suggest stuff like this will be specified in the future in
> javadocs for the framework package and in an xdoc for the framework
> reference, and until things finalize inside the containerkit/meta
> package.

I'd suggest also:

public class AvalonContextKeys{

    public static final CONTEXT_HOME_DIR = "avalon:context.home.dir";

Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)

To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message