On Mon, 31 Dec 2001 03:03, Magesh Umasankar wrote:
> > I am +1 on metadata. Personally I think the md. associated with an attr
> > should be very detailed:
> >
> >  /**
> >   * @since 1.9
> >   * @ant:attribute set the dir to use
> >   * @ant:default current dir
> >   * @ant:optional
> >   * @ant:validator org.apache.ant.validators.SourceDirValidator
> >   */
> >  void setSrcDir( File src )
> >  {
> >  }
>
> Are we planning to switch from a runtime interpreted environment to
> a compile build file/execute build file scenario?  Won't this severly
> hamper the APIs from being used in a straightforward manner?

If you want the extra wiz/bang features to be done for you (ie document 
generation, TaskInfo generation and whatever) then you can run a tool to 
generate them. If you want to implement validation like it is today then you 
should feel free to ignore this step ;)

Whats not straightforward about that?

> Can't we instead introduce methods like getSrcDirValidator,
> getSrcDirAttribute, getSrcDirDefault, isSrcDirOptional, etc?

Im not sure how that is easier.

> > void setSrcDir( File src ) {
> >    validator.validateSrcFileWithFailOnError(src,failonerror,"We cant use
> > file {0} because of {1}");
> >  }
>
> Problem is if somebody overrides this method in a subclass,
> and implement their own stuff, validation will no longer occur.
> Also, what if somebody overrides the method in the subclass
> without providing them metadata details as proposed?
> How will this be handled?  WIll the superclass's stuff be
> implemented or not?

In the architecture we have discussed for Ant2 it will be very difficult to 
subclass tasks unless they are in the same tasklib. So if there is behaviour 
that needs to be shared it should be refactored into another bean and 
delegated to. In the rare cases that do need inheritance it is expected that 
you don't mess things up ;)

No idea if base classes TaskInfo will add to or be replaced by subclasses 
TaskInfo.

-- 
Cheers,

Pete

"Artists can color the sky red because they know it's blue.  Those of us who
 aren't artists must color things the way they really are or people might 
 think we're stupid." -- Jules Feiffer 


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

Reply via email to