Hey,

As I'm going through the persistence refactoring it is becoming even more difficult to decide where to do type and where to do state. Currently the main problem is for properties. EntityState has setProperty(name, value), where value is a Java object. Writing is typically fine, but when the state is to be deserialized using getProperty(name) it is trickier, because the EntityState/EntityStore does not necessarily have any access at all to the type information.

Right now I have done a quick-fix by changing getProperty to include ValueType as a parameter, but it seems weird. One option is to go really hardcore with state/type separation and have setProperty(name,byte[]) in EntityState. Then all type handling has to be done in layers above EntityStore. This makes it tricky to do EntityState serialization though as the serializer has to have access to both the EntityState and the EntityType. This is true both for the REST access service and the RDF indexer, for example.

I'm not sure how to handle this. Any ideas?

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to