ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: DispatchTask
Date Wed, 02 Jun 2004 18:50:53 GMT
> From: Magesh Umasankar [mailto:umagesh@apache.org]
> Hi,
> 
> I'd like to introduce the concept of a DispatchTask to Ant.  This class
> may
> be subclassed by tasks that perform multiple operations depending upon a
> parameter.  Currently, the task-writer would be using if...else if...else
> constructs.  Extending from this class would make it more elegant.  Use
> cases include tasks that take in same set of parameters but perform
> different operations based on needs.
> 
> Example usage would be:
> 
> <somecompoundtask param1="..." param2="..." mode="list"/>
> 
> In the above example, the custom task writer extends from DispatchTask
> instead of Task and implements a method with the signature:
> public void list() throws BuildException

Hi Magesh. It's been a long time ;-)

What's the advantage of this other writing different tasks, possibly with
the usual Java code re-use? Especially if different modes require different
params. I've written at least one task with an action attribute and then do
the dispatch based on it, but I don't think this should be made into a
framework. What's your more specific use case? --DD

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


Mime
View raw message