|
[
Permlink
| « Hide
]
Dave Syer added a comment - 19/Feb/08 02:57 PM
I think LineAggregator was overlooked when ItemProcessor/Writer was refactored. I can see there might be some value there, but I can't see where a LineAggregator is going to get a String[] from. If the item is on type String[] (not very likely) it sort of works like a transformer. How did it ever make sense?
I think the idea would be that the transformer would define how to transform the object into a field set (i.e. a string array) and the aggregator would determine how to write each field in the field set, so each one would serve a distinct purpose in the process of writing.
Why aren't we using the FIeldSet paradigm here again? I like the idea of symmetry between reader and writer. Here's how I see the line aggregators working...
And how I see the item writer...
I took the inspiration from your patches, and changed the interface of LineAggregator for symmetry with LineTokenizer. The FFIW still has an injected ItemTransformer, but that could be one that uses a LineAggregator. I might change that to be more like your patches if I get time later this week.
Great fix! One thing though, I'm not sure that "Unmapper" is a good way to name it - it's still a mapper, just in the reverse direction. Maybe the Mapper should be called InputFieldSetMapper and this one OutputFieldSetMapper... or Reader/WriterFieldSetMapper...
Unmapper doesn't sit well. Thanks! |
|||||||||||||||||||||||||||||||||||||||||||||||||