From: Stefan Bodewig <bodewig () apache ! org> Date: 2004-06-04 12:45:50
Hi Stefan, > > I'd like to introduce the concept of a DispatchTask to Ant. > > Do you think a task with a mode/action that selects the method to run > instead of execute is really that common? Well, it is a pretty common pattern used to group closely related sub-actions together while avoiding messy conditionals (like in our very own FTP). On a tangential note, Struts has a similar concept called DispatchAction, which is popular. A couple of third-party task implementations that use 'actions' instead of defining individual tasks are: - Weblogic's wlserver that allows startup, shutdown, connect and reboot as action options. - Dale Anson's Stopwatch task at Ant-contrib (a very nice use-case for DispatchTask) that allows start, stop, elapsed and total as action options. I'm sure there are plenty more... > It looks like one could start a debate over whether those shouldn't > better be split into several separate tasks. Even in Ant we have both > extremes, compare the clearcase/VSS or starteam tasks on the one and > ftp on the other side. Whenever I touch ftp it feels as if it should > have been multiple tasks instead - so I'm in the multiple task camp > and probably wouldn't use DispatchTask myself. I don't see it as a debate on whether multiple tasks are better Vs. mutiple actions per task. DispatchTask is to be viewed as an alternative to writing multiple tasks and must be used diligently. It is just a question of style and a question of choice. > Stefan Cheers, Magesh --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]