|
[
Permlink
| « Hide
]
Lucas Ward added a comment - 07/Apr/08 09:49 AM
I have to say I'm not sure I like the idea of pushing the processing logic back into the Tasklet from where we had it before. I suppose it's a difference between having one step with multiple Tasklet implementations or multiple Step implementations. It seems like the former would be a step backwards. I know the addition of FactoryBeans helps somewhat, but I'm just not sure I like taking the Tasklet and rebranding it as essentially the StepExecutor, only different. I think having multiple Step implementations is still the right way to go.
I think it is largely an "inheritance vs. composition" question - AbstractStep currently declares 3 abstract methods, we could instead define an interface declaring these methods and inject a collaborator into the step.
I had mixed feelings when this change was first made in the opposite direction... but now that I think about it I like the idea of ItemOrientedStep much better than ItemOrientedTasklet... here's my reasoning:
1. It makes item-oriented processing a top-level concept ... Okay, that's really it - item-oriented processing is a top-level batch processing concept - it is the most common use case and it's a best practice... (that is, other transaction boundaries aside -- ChunkedStep is still item-oriented processing). It also makes me feel less gross about the Tasklet paradigm - it really gives the Tasklet a specific role as a means to accomplish an arbitrary not-necessarily-item-related task rather than as an all-encompassing blank abstraction. Look at the API - how many Tasklet-related classes do you see? How many item-oriented processing collaborators, helpers, support classes, adapters, implementations, etc. do you see? This alone illustrates the importance of each in the grand scheme of things, in my opinion. As it stands now, the Tasklet is a custom extension point, not a fundamental stereotype, and I like it much better this way. There IS a second, much-less-convincing argument, which is that it's just more convenient to configure: <bean class="...ItemOrientedStep> <!-- item readers/writers/etc --> </bean> VS. <bean class="...SimpleStep> <bean class="...ItemOrientedTasklet"> <!-- item readers/writers/etc --> </bean> </bean> but I maintain that it should remain as is on merit of making items a first-class paradigm alone. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||