diff --git a/docs/getting_started.md b/docs/getting_started.md index ecae6fbce53d75f5317a35eacf0d89d25363ed2f..0da30c74a3f551e838ecd0a560d07435c789d571 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -1,8 +1,4 @@ -Ferma provides three levels of type resolution: untyped, simple, and annotated. In untyped mode Ferma doesn't handle -typing at all, instead the type must be explicitly indicated whenever querying. In simple mode Ferma provides type -context encoded as graph element properties which ensures the same type comes out that goes in to a graph. In annotated -mode all the features of simple mode are provided as well as enabling the use of annotations on abstract methods to -instruct Ferma to dynamically construct byte code to implement the abstract methods at start up. +Ferma provides three levels of type resolution: untyped, simple, and annotated. In untyped mode Ferma doesn't handle typing at all, instead the type must be explicitly indicated whenever querying. In simple mode Ferma provides type context encoded as graph element properties which ensures the same type comes out that goes in to a graph. In annotated mode all the features of simple mode are provided as well as enabling the use of annotations on abstract methods to instruct Ferma to dynamically construct byte code to implement the abstract methods at start up. ## Dependency @@ -18,8 +14,7 @@ To include Ferma in your project of choice include the following Maven dependenc ## Untyped Mode Example -In untyped mode there is no automatic typing. Whatever class is explicitly indicated is the type that will be -instantiated when performing queries. Lets start with a simple example domain. +In untyped mode there is no automatic typing. Whatever class is explicitly indicated is the type that will be instantiated when performing queries. Lets start with a simple example domain. ```java public class Person extends AbstractVertexFrame { @@ -77,10 +72,7 @@ public void testUntyped() { ## Simple Mode Example -In simple mode you must provide concrete classes, no abstract or interfaces allowed, and the class should always extend -from a FramedVertex or FramedEdge. Simple mode doesn't provide any annotations either. The purpose of simple mode is to -provide type resolution. Basically the type of object you use when adding to the graph is the same type you get out when -reading from the graph. +In simple mode you must provide concrete classes, no abstract or interfaces allowed, and the class should always extend from a FramedVertex or FramedEdge. Simple mode doesn't provide any annotations either. The purpose of simple mode is to provide type resolution. Basically the type of object you use when adding to the graph is the same type you get out when reading from the graph. Say we extend the Person class with the Programmer class. @@ -88,9 +80,9 @@ Say we extend the Person class with the Programmer class. public class Programmer extends Person { } ``` - + Using simple mode will save the type of Java class the element was created with for use later: - + ```java public void testSimpleTyping() { Graph graph = TinkerGraph.open(); @@ -114,11 +106,7 @@ public void testSimpleTyping() { ## Annotated Mode Example -In annotated mode you can either provide concrete classes, abstract classes, or even interfaces. Abstract classes and -concrete classes must extend from FramedVertex or FramedEdge, however, interfaces do not have this restriction. -Annotated mode also provides a set of annotations which must be used to define any abstract methods that are to be -implemented by the engine. Annotated mode provides the same type resolution as provided by simple mode with a bit more -power to determine parent-child relationships at run time. +In annotated mode you can either provide concrete classes, abstract classes, or even interfaces. Abstract classes and concrete classes must extend from FramedVertex or FramedEdge, however, interfaces do not have this restriction. Annotated mode also provides a set of annotations which must be used to define any abstract methods that are to be implemented by the engine. Annotated mode provides the same type resolution as provided by simple mode with a bit more power to determine parent-child relationships at run time. The same example as above done with annotations would look something like this. @@ -162,9 +150,7 @@ public abstract class Programmer extends Person { } ``` -If we pass a collection of Class objects to the FramedGraph constructor then the annotated type resolver will be used. -In this mode you want to tell the engine what classes you will be using so it can handle type resolution properly and -construct the byte code for any abstract annotated methods. +If we pass a collection of Class objects to the FramedGraph constructor then the annotated type resolver will be used. In this mode you want to tell the engine what classes you will be using so it can handle type resolution properly and construct the byte code for any abstract annotated methods. ```java public void testAnnotatedTyping() { @@ -190,4 +176,4 @@ public void testAnnotatedTyping() { Assert.assertTrue(Programmer.class.isAssignableFrom(jeffAgain.getClass())); Assert.assertTrue(Person.class.isAssignableFrom(juliaAgain.getClass())); } -``` +``` \ No newline at end of file