[Frames] FramesManager is now a FramedGraph implements WrapperGraph

21 views
Skip to first unread message

Marko Rodriguez

unread,
May 21, 2012, 12:28:25 PM5/21/12
to gremli...@googlegroups.com
Hi,

Given all the work on Blueprints and the WrapperGraph interface, I realized that FramesManager is simply a "wrapper graph." (WrapperGraph interface was provided by Jordan Lewis)

As such, we have redesigned Frames for TinkerPop 2 and you now work with Frames like this:

FramedGraph<Neo4jGraph> graph = new FramedGraph<Neo4jGraph>(new Neo4jGraph("/tmp/neo4j"));
Person person = graph.getVertex(1, Person.class);
person.getName(); // equals "marko"

All the other standard graph methods are in FramedGraph, as

FramedGraph<T extends Graph> implements Graph, WrapperGraph<T>

However, there are extra "framing" methods to get your respective domain objects that are respective of the look-and-feel of Graph:

Iterable<Person> people = graph.getVertices("location", "santa fe", Person.class)
Person marko = graph.getVertex(1, Person.class)
Person pierre = graph.addVertex(null, Person.class);
pierre.setName("pierre");
pierre.addKnowsPerson(marko);
...

Pretty cool, eh?

** Pushed to GitHub and deployed to SonaType SNAPSHOT as 2.0.0-SNAPSHOT **

Enjoy!,
Marko.

http://markorodriguez.com

Jordan Lewis

unread,
May 21, 2012, 12:50:19 PM5/21/12
to gremli...@googlegroups.com
Great job, Marko! I'm really looking forward to the culmination of everyone's work on Tinkerpop 2.0.

- Jordan
Reply all
Reply to author
Forward
0 new messages