Uggggg. I said Testlet in many places where I should of said Tasklet. Fixed now I hope :P
At 01:12 30/6/00 +1000, you wrote: >Hi, > >I have another request that I am not 100% sure about yet but are just >throwing it out for comments. A couple of my tasks are getting rediculously >large - mainly due to huge number of property setters. Also I am getting an >increasing amount of validation code in execute method. So what I would >like to suggest is some work at delegating more responsibility to >AbstractTasklet class and less to the other classes in Ant. Essentially >what I would like to see is that the interface for Task be reduced to simply > >void execute( TaskContext context ) > >TaskContext would hold all parameters and also give access to functionality >like path transformation etc. > >However as this would brake 100% of current tasks there may be use in >creating an AbstractTasklet that implements some of the missing >functionality. Any of the old tasks can simply inherit from AbstractTasklet >and work as they do now. > >The most important things that AbstractTasklet does is implement: > >void execute( TaskContext context ) > >It would implement it in a manner such that it gets all parameters, then >through reflection sets them all in the same way that they are set now. It >would then call init() and execute() of the task. This would mean that all >tasks would work as they do now as long as they inherited from void >AbstractTasklet. However this would allow some tasks to do all sorts of >wierd and wonderful things, including partial automatic validation. This >would greatly reduce the work needed to write a new task and similar >approaches have been taken in other frameworks. Servlets already do this >partially via Generic/HttpServlet and I do it in a few of my own frameworks >(Gamelet,Testlet etc) so it is not too radical. It just makes writing tasks >so much easier :P. > >Thoughts ? > > >Cheers, > >Pete > >*------------------------------------------------------* >| "Nearly all men can stand adversity, but if you want | >| to test a man's character, give him power." | >| -Abraham Lincoln | >*------------------------------------------------------* > Cheers, Pete *------------------------------------------------------* | "Nearly all men can stand adversity, but if you want | | to test a man's character, give him power." | | -Abraham Lincoln | *------------------------------------------------------*
