ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types
Date Sun, 06 Jan 2002 20:45:36 GMT

----- Original Message -----
From: "Jose Alberto Fernandez" <j_a_fernandez@yahoo.com>
To: "Ant Developers List" <ant-dev@jakarta.apache.org>; "Magesh Umasankar"
<umagesh@apache.org>
Sent: Saturday, January 05, 2002 7:23 PM
Subject: Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/types




>An additional reason why I have problems with your approach is that
>it assumes that parameters must be valid at the time the attribute is set,
>and not when they are actually used (execute). Although the two events
>may occur at close time for most tasks, this may not be the case for
>always, like for example in the case of a DataType.

>For datatypes, you may have the declaration operation ( when the attributes
>are set) happening quite early in the build process, while the actual usage
of the
>datatype by some task may occur much later. in such cases we may want to
>wait for the validation to occur when the reference is used.

This is an important issue, which I am glad you have pointed out.

1. scripting in ant can be used to set properties way, way, before the task
is executed

2. if you subclass a task, you could override set methods to bypass
validation,

For both those reasons, there is significant merit in performing validation
at execute time, rather than assuming that by the time the method is called
all inputs are valid.

This would argue for the setters being simple, and the validation code,
whether done by hand, through some FileObject.mustBeSrc(), or by
validator.mustBeSrc(File) calls.
-steve


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message