On Sun, 30 Dec 2001 16:27, Magesh Umasankar wrote:
> From: "Peter Donald" <[EMAIL PROTECTED]>
>
> > Justa note that I would prefer that changes like this be discussed before
> > they get done or at least implemented in a proposal branch first.
>
> ok, but I understood you OKed some sort of a wrapper. 

I guess I must have got confused - which thread was this in again? It 
probably would have been useful to show code snippets as I talk better in 
code ;)

> I can back them out,
> of course, if you are giving a -1 to this implementation (I understand you
> are
> from what I read, but please confirm).  If you had provided these comments
> earlier, it might have helped too.

Not a -1 more a -0. If you want to fix it then do it if you don't consider it 
in need of fixing then feel free to ignore me ;)

> > Type and validation of type are different concepts and shouldn't be
> > merged together. There should be a method that allows validation to be
> > extracted
>
> EnumeratedAttribute, IIRC, performs validation also...

Thats only because Ant1.x has a abysmal type system ;) If it was impossible 
to create an enum that wasn't one of the selected enums then you would need 
no validation. BTW I just implemented this in myrmidon yesterday. Have a look 
at antlib.core.StringToEnumConverter ;)

>
> > outside the task but I don't like the way that you do it. For example
> > lets consider that there may be N different types. Each instance of a
> > type may have M rules applied to it. Thus under your system you could
> > potentially
>
> have
>
> > N x M objects!!!! I would much prefer to have just M objects that could
> > be composed together - much more manageable ;)
>
> Hmm... what if the validator class composes the validation using
> other smaller validator class methods?  We can also do some daisy chaining
> mechanism this way.  Or, have I not understood correctly the issue you
> are pointing out?

Precisely what I was thinking! 

> > /**
> >  * ...
> >  *
> >  * @validator org.apache.ant.validators.SourceValidator
> >  */
> > void setSrc( File src )
> > {
> > }
>
> This type of mechanism might not be ideal for the API user?  What you say
> will
> have an effect only if setSrc is invoked by An't core.  If say somebody
> uses Ant's API to launch a task from some external environment for whatever
> reason,
> the checkings will not happen.  I see you are proposing something similar
> to @assert?

If the ant task itself is used outside ants container it is likely going to 
have issues anyway. Both Ant1.x and Ant2 will most likely continue to behave 
in this manner so I don't consider this a great loss.

> > should be relatively easy to implement by Task writers (not so easy for
> > us though).
>
> Let me know.

Do whatever you feel like - I was basically just saying - erk! 

-- 
Cheers,

Pete

--------------------------------
 These aren't the droids you're 
 looking for. Move along. 
--------------------------------

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

Reply via email to