avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: [A5:Proposal] Initial interfaces
Date Sun, 12 Jan 2003 16:44:04 GMT
Leo,

I haven't had time to follow all of this as much as I want, but ...

>   lookup ("configuration:/my/config/element");

> how do we handle namespaces in the Configuration?

I thought that the pattern was to be a URI, formatted as
"scheme:scheme-specific-uri".  And I am using URI very specifically to
explicitly remove the question of how the scheme specific part is used.

See: http://ftp.ics.uci.edu/pub/ietf/http/hypermail/1995q3/0799.html
and: http://lists.w3.org/Archives/Public/uri/1997Oct/0053.html

In my view, the first thing that would happen is that the scheme would tell
the lookup service which provider to use, and that provider would deal with
the rest of the lookup.

See: http://java.sun.com/products/jndi/tutorial/beyond/url/index.html for
how this works with JNDI.

>  Configuration conf = lookup ("configuration");

This implies, from my perspective, that one can get a reference the service
provider, and work wit it directly, which I would not consider to be a good
thing.  On the other hand, I think it might be OK to be able to do something
like this:

   LookupService configuration =
someLookupService.lookupService("configuration");

which does nothing more than provide a LookupService with some pre-defined
context, such that I could now do a query as:

   MyElement myElement = (MyElement)
configuration.lookup("/my/config/element");

In fact, you could do:

   LookupService configuration =
someLookupService.lookupService("configuration:/my/config");

and then be able to query the elements by name.

To items to note:

  (a) This is just shorthand for the full URI,
  (b) The lookupService() operation will return null
      if it cannot provide such a pre-defined service.

> add helper methods to the Context interface - lookupAsInteger,
> lookupAsBoolean, etc, but then I think we're re-creating the
> Configuration interface.

As you may recall, I had previously suggested that a form of lookup take a
class:

	lookup(String, Class);

to allow the service to do certain kinds of checking.  I don't have a
problem with utility methods of the type you propose to supplement.

	--- Noel


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


Mime
View raw message