Issue Details (XML | Word | Printable)

Key: BATCH-292
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Critical Critical
Assignee: Unassigned
Reporter: Gregory Kick
Votes: 0
Watchers: 0
Operations

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

is JobIdentifier a strategy?

Created: 15/Jan/08 10:57 AM   Updated: 16/Jan/08 04:02 AM
Component/s: Core
Affects Version/s: 1.0.0.m4
Fix Version/s: 1.0-m3

Time Tracking:
Not Specified


 Description  « Hide
Job Identifier is documented as being a strategy (and as such, is an interface). However, the interface really seems to define a value object that is used as a unique key. Thus, the primary use for a JobInstance is .equals() and .hashCode().

E.g.

if (registry.containsKey(jobIdentifier)) {
return ((JobExecutionHolder) registry.get(jobIdentifier)).getExecution();
}

This requires that .equals() and .hashCode() are consistently implemented across all implementations of JobInterface. I don't have my copy of "Effective Java" around, but it's pretty clear in how unlikely that is (especially with no documentation about the fact that it will be used that way).

A more appropriate alternative would be to convert JobIdentifier to a value object and provide factories for conveniently populating different properties (e.g. JobIdentifier newScheduledJobIdentifier(String jobName, Date scheduleDate)).

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Lucas Ward added a comment - 16/Jan/08 04:02 AM
This issue is a duplicate of BATCH-288, so it is being closed. The description has been added as a comment to 288.