History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BATCH-389
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Robert Kasanicky
Reporter: Wayne Lund
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

Two samples could make use of our ValidatingItemReader instead of DelegatingItemReader.

Created: 26/Feb/08 01:29 PM   Updated: 05/Mar/08 08:26 AM
Component/s: Samples
Affects Version/s: 1.0.0.m5
Fix Version/s: 1.0.0.rc1

Time Tracking:
Original Estimate: 0.5d
Original Estimate - 0.5d
Remaining Estimate: 0.5d
Remaining Estimate - 0.5d
Time Spent: Not Specified
Remaining Estimate - 0.5d

Environment: 1.0.0.m5


 Description  « Hide
While reviewing the models I found that we have a ValidatingItemReader in our list of ItemReaders but it seems it's only an example of how to use the DelegatingItemReader for validation. I've noticed that none of the other "Validating Readers" like OrderItemReader and TradeItemReader from the samples project are subclassing ValidatingItemReader. However, if they would have subclassed ValidatingItemReader instead of DelegatingItemReader they would have written less code and it serves as a nice example of the proper use of ValidatingItemReader.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Robert Kasanicky - 05/Mar/08 07:40 AM - edited
OrderItemReader has validating behavior, but it is not compatible with ValidatingItemReader - the ValidatingItemReader validates item after every read() while OrderItemReader uses many reads to compose the Order item which is then validated (so subclassing doesn't work).
We can probably remove the validating logic from OrderItemReader and wrap it by ValidatingItemReader in job configuration

TradeItemReader is just a test helper class with no validation behavior - or am I missing something?

Robert Kasanicky - 05/Mar/08 08:13 AM
removed validation logic from OrderItemReader and used ValidatingItemReader wrapper instead