[Neo] Dynamic properties...

Atle Prange atle.prange at gmail.com
Fri Apr 17 12:18:23 CEST 2009

On Fri, 2009-04-17 at 10:25 +0200, Mattias Ask wrote:

Hi Mattias,
interesting question.

Maybe you can model the relation to toher Persons as typed
relationships, that way you get the same model as in neo4j. 

You have a class called Relationship, with a type marker
(RelationshipType) and a container class called Relationships.

Then you call getRelationships().contains(RelationshipType.CHILD) on
your Teenager...

> Hi,
> I have a new problem which I've never encountered before... Code, and  
> not the persistence, restricts what I want to do.
> I love Neo4j since it matches how I think of informations, but due to  
> that I now I find that Java doesn't. What is it I want to do?
> Let's say you have a Teenager. In some cases you are interested in  
> Teens with children. Should your Teenager class have an method called  
> getChildren() or isParent()? I say no, since the vast majority of  
> Teens do not have children... Down in Neo this isn't a problem, since  
> you just add relations to the Child, or add a hasChildren property, to  
> the specific Teenager that has kids. But in Java...
> Things that comes to mind are mix-ins, AOP, Qi4j, dynamic languages  
> etc.... but I'm just a simple Java programmer that happens to think in  
> nodes. What would you say is the easiest way for me to handle this  
> flexibility in Java code?
> I think Rickard Öberg says "Classes are dead. Long live Objects!" when  
> he talks about Qi4j (www.qi4j.org) and I find myself very attracted to  
> that thought...
> Best regards, Mattias Ask
> -------------------------------------------
> Jayway AB, +46 701 469284
> www.jayway.com
> Jayway is the founder of Öredev and Qi4J
> www.oredev.org
> www.qi4j.org
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

More information about the User mailing list