Leo Sutic wrote:
> Peter,
>
> in the following:
>
> <provides>
> <role>
> <key>conn-manager</key>
> <interface>org.apache.avalon.ConnManager</interface>
> </role>
> </provides>
>
> the key, "conn-manager", implies "org.apache.avalon.ConnManager", right?
Seems like no... It can be also cm connecm, or whatever.
But...
This Role=Interface+Metadata is biting us as a definition throughout
(correct spelling? ;-) the Avalon history.
Remember for example the role=interfaceVSlookup key debacle of some
months ago.
Now, we have said that Role=Interface+Metadata.
The poin now is: how to describe it?
The most language neutral way is by defining it in an XML descriptor
*without* interface names and define a set of rules for language bindings.
OR
Define it in the language like Java interface+javadocs4xdoclet and have
the doclet create the info file.
Either way, we have a descriptor, that describes a role.
As a moniker, it has a name, which is now the key, a set of attributes,
and an interface descriptor.
What we need is a means of describing the interface.
<role id="org/apache/avalon/connectionmanager">
<attribute name="lenient" value="true">
It tells Avalon to...
</attribute>
<action name="getconnection">
It gets a connection for...
<param name="keepalive" type="boolean">
It specifies if it has to...
</param>
</action>
</provides>
Would translate automatically into:
/**
* @lenient true
**/
interface ConnectionManager{
/**
* It gets a connection for...
* @param keepalive t specifies if it has to...
**/
public getConnection( boolean keepalive ){
}
}
> So isn't the <interface/> element redundant?
>
> I assume you will use the <key/> to define exactly what attributes may
> be set for the connection manager. That is, "conn-manager" implies:
>
> + A certain interface (org.apache.avalon.ConnManager)
>
> + A set of attribute keys (for example, it may declare "is-secure")
>
> Is this a correct understanding of the <key/> element?
>
> If it is, I really do not see the need for the <key/> element. It
> should be the same as the <interface/> element.
The key and the interface in fact have to be the same, as you say.
I cannot have the same interface used with different attributes for
different keys in Java.
--
Nicola Ken Barozzi [EMAIL PROTECTED]
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>