Laval Chung wrote:
For subtask we either create or add?
What's the difference and when to use which?

Cheers
laval


When you use addXXX, Ant will instantiate the object, pass it to the add method and then configure it. For Ant to be able to instantiate the class it must support a Zero Argument Constructor (ZAC).


When you use createXXX, Ant will call createXXX and your task must create the sub-object and return it to Ant which will then configure it. As such your task can create the sub-object with whatever means available.

BTW, the above is the simple explanation :-).

In general, the preference nowadays is to use addXXX methods. These are more extensible since Ant can provide a subclass of the class required by the addXXX methods. That isn't much of an issue today but in the future such behaviour is envisaged.

Also, it is not strictly a sub-task - more a sub-element.

Conor



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



Reply via email to