|
I think when JobRuntimeInformation was first designed it was supposed to solve this problem: an extensible identity for a Job instance. We lost sight of that, and JobRuntimeInformation is now pretty useless (see
We can provide more than one implementation of the JobIdentity and JobIdentityDao out of the box - I think that's the hierarchy that Wayne is taling about. Then the scheduleDate crowd will have something that works for them, but is only one implementation of a strategy for JobIdentity. JobInstance (formerly known as Job) has very little information that is not an "identifier". There is a surrogate key and a status. The rest could be abstracted into an interface JobIdentifier (replacing JobRuntimeInformation) with implementations having optional properties like scheduleDate and jobStream. The basic interface needs only a name property (matching the job configuration) and a label (or something), which makes the instance unique in the absence of any other properties in the implementation.
I actually start to warm to Hibernate annotations at this point (Java 5 only unfortunately) because the implementation of JobIdentifier could map itself with no changes to any other code, giving maximum flexibility for projects. With XML mapping it only works out of the box with no changes if JobIdentifier is an Entity (yuck - it just isn't) and the mapping file can be overridden (not sure how that would work). With SQL it is more straightforward - but less pleasant because the client has to provide an additional Dao for the identifier. Added a subclass mapping to JobInstance in the Hibernate case that copes with JobIdentifier strategies SimpleJobIdentifier and ScheduledJobIdentifier. Once the Jdbc case works we can close this for the present - until more JobIdentifiers are needed (e.g. for
Sql and Hibernate JobDao implementations are now able to cope with Simple- and ScheduledJobIdentifier strategies. There is also a JobIdentifierFactory for each one. When more are needed we might need a new extension point to simplify the Jdbc case. Hibernate can probably always work with the EntityNameInterceptor.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I believe that projects would rather start from a common schema with a way to enhance then simply being handed a map to fill up with user defined properties.