> -----Original Message-----
> From: Peter Donald [mailto:[EMAIL PROTECTED]
> Sent: Saturday, 9 February 2002 7:25 PM
> To: Ant Developers List
> Subject: Re: cvs commit:
> jakarta-ant/proposal/myrmidon/src/testcases/org/apache/myrmidon/componen
> ts/configurer ConfigTest10.java StringToMyRole1Converter.java
> DefaultConfigurerTest.java MyRole1.java
> 
> 
> On Sat, 9 Feb 2002 20:10, Adam Murdoch wrote:
> > > I still don't understand the motivation for this. Instead of
> > > MyRole lets say
> > >
> > > interface Condition extends DataType {}
> > >
> > > add( Condition c );
> > >
> > > Why would you want to look up an arbitrary DataType? Wouldn't it
> > > be best to
> > > just look up types that implement Condition?
> >
> > Absolutely.  The trick is to come up with a type definition system that
> > lets you figure out which types implement the role interface, while also
> > making those same types available via <property> or TypeInstanceTask.
> 
> Okay 
> 
> > Any thoughts on a better solution?
> 
> Whats wrong with automagically generating this via xdoclet or something 
> similar to what it is doing now? Thus any class that implements DataType 
> directly or indirectly must have a 
> 
> @ant:data name="foo"
> 
> if it wants to be exposed in property or via TypeInstanceTask?
> 

Sure, but you have to have a tag for each of the role interfaces the type 
happens to implement, directly or indirectly.  This isn't a bad thing if you 
want complete control over where a type can be used.

Personally, I couldn't care less where a type that I write gets used.  I want 
Ant to figure it out for me.  Same with the implicit TypeInstanceTask - I want 
that to just happen.  So, when I write a type, I don't want to have to do 
anything more than add a *single* tag that says 'this is a data-type, and this 
is its name', and have Ant do the rest for me.

The solution we come up with should deal with both styles.  Unfortunately, I 
don't think we can do all this via XDoclet, some of it's going to have to 
happen when the type is deployed.

How about we use two separate tags to define types:

@ant:data-type name="blah"

Would indicate that the type is to be implicitly registered under all roles 
that it implements, and as a TypeInstanceTask.

@ant:type role="some-role" name="blah"

Would indiciate that the type is to be registered only under the specified 
role.  A type would have one of these tags for each role that it is to be 
registered under.

These two tags would probably just translate into an 'implicitRoles' attribute 
on the type definition in the antlib descriptor.  The deployer (or more likely 
some pluggable component) would take care of implicitly registering the type 
under all roles that it is castable to, and adding a TypeInstanceTask 
definition for the type.


Adam


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

Reply via email to