The class DataRange in the meta model component at this moment is a subclass of
RdfDataTypeRange, which in my opinion is not optimal. DataRange is used to
enumerate the values a certain PropertyType can have and in that sense can be
seen as a DatatypeClassRange with further restrictions.
DatatypeClassRange has some dependencies on RDF but only in its
rdfLiteralToJavaObject and javaObjectToRdfLiteral methods, both of which are
not required to be used. DataRange on the other hand has dependencies on RDF in
the internalLoad and internalStore methods, which use is not optional.
As a result it is possible to give the DatatypeClassRange constructor as
argument the class java.lang.String, and do the appropriate cast of Object to
String in user code. The same is not possible with DataRange, which has a
constructor having a String as first argument, which needs to correspond with
some predefined RDF types. So instead of giving the argument "java.lang.String"
and doing the proper cast in user code, the argument needs to be
"http://www.w3.org/2001/XMLSchema#string".
This dependency on RDF is far from ideal. I would like to be able to say that a
DataRange can have any type of class, and do the proper casting/transformation
in user code. With DatatypeClassRange I can do that. It is possible to use any
class for DatatypeClassRange and do serialization to and from a property value
in user code (after all, any serializable class can be written into a byte
array or into a String).
My suggestion is to make DataRange a subclass of DatatypeClassRange, changing
the first constructor argument from String into Class and have a check that all
Objects passed as the second constructor argument conform to that Class.
Of course I am willing to make this change, but I'd like to have feedback
before doing so.
Niels Hoogeveen
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user