Today Andreas Kollegger and I had an interesting discussion about the 
prevalence of class based mapping of entities to a graph store.

One of the strengths of a graph store is that you don't need a strict schema 
for your data and you can use lots of different projections to work with it.

Spring Data Graph currently focuses on a single projection of a node to an 
entity instance (1:1) that traditional ORMs focused on.

But we could do more. We can project the node to many different classes, as 
long as the properties that are part of the class are there, we can sensibly 
work with the node.
Even if the projection class is not part of the type hierarchy that was 
originally used to create and populate the node it can be used to access it.

That makes room for some interesting things like:
* new domain concepts can be used on top of existing data
* get rid of inheritance hierarchies
* traverse over a lot of nodes that support some basic properties that form a 
concept (e.g. Person) using that simple concept during the traversal and from 
there project those nodes to more concrete concepts as needed (e.g. Employee, 
Customer)
* data/schema evolution / versioning

We can run DATAGRAPH in a strict mode (not default) where it checks that the 
node requested always fit to the domain class specified (according to the type 
hierarchy stored in the graph). But we can (and should promote) running it in a 
more loosely
coupled way where this free projection is possible.

I would like to introduce a <T> T NodeBacked.projectTo(Class<T>) method to the 
aspect so that this projection is easily available.

Looking for feedback on that.

Cheers

Michael
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to