> -----Original Message-----
> From: Peter Donald [mailto:[EMAIL PROTECTED]
> Sent: Saturday, 9 February 2002 5:31 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 12:49, Adam Murdoch wrote:
> > > On Sat, 9 Feb 2002 09:33, Adam Murdoch wrote:
> > > > >   * Uses the DataType role when creating instances for interface
> > > > > properties,
> > > > >     rather than using the interface itself as the role.
> > > >
> > > > The motivation for this change was to allow a data type to 
> be used in
> > > > <property>, TypeInstanceTask, and as a parameter to add() methods.
> > >
> > > Im not sure I follow you here. If I have a
> > >
> > > add( MyRole value );
> > >
> > > will that look up in the registry under MyRole or DataType?
> >
> > DataType.  Same as <property> and TypeInstanceTask.
> 
> 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.

I don't think it's anything incredibly difficult, just something I didn't want 
to tackle straight away.  The simplest solution was just to treat everything as 
a DataType.  It's not a bad solution - though it does force everything that 
needs to be add()'ed to implement DataType (this probably isn't a bad thing 
anyway).

Any thoughts on a better solution?


Adam


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

Reply via email to