Issue Details (XML | Word | Printable)

Key: NUCCORE-1192
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

DatastoreId and SingleFieldId are similar in terms of methods; commonise and have common parent interface

Created: 22/Apr/14 11:12 AM   Updated: 24/Apr/14 11:00 AM
Component/s: Code Structure
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
Both are for an "identity" that represents a persistable type, with a single "key". There should be much commonality

Andy Jefferson added a comment - 23/Apr/14 07:46 PM - edited
Problem areas are :
1. JDO javax.jdo.identity classes (that we need to convert back and forward to) uses class as arg in constructor (for no reason ... String would do); wastes space.

2. SingleFieldId doesn't have a String constructor that takes the output of toString(), and toString() doesn't include the target class name.

3. DatastoreId classes allow configuration of the toString() method, but SingleFieldId doesn't. One way around this is to have a separate handler for the string form of the id (like IdentityUtils has a method getPersistableId()) so then we could dispense with DatastoreIdKodoImpl, DatastoreIdXcaliaImpl etc also maybe

Have now removed the majority of unnecessary references to DatastoreId/SingleFieldId and use IdentityUtils instead.

Andy Jefferson made changes - 24/Apr/14 11:00 AM
Field Original Value New Value
Summary OID and SingleFieldId are similar in terms of methods; commonise and have common parent interface DatastoreId and SingleFieldId are similar in terms of methods; commonise and have common parent interface