Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create NameSpec and ConfigSpec #89

Closed
moaxcp opened this issue Jul 11, 2017 · 1 comment
Closed

Create NameSpec and ConfigSpec #89

moaxcp opened this issue Jul 11, 2017 · 1 comment
Projects

Comments

@moaxcp
Copy link
Owner

moaxcp commented Jul 11, 2017

If VertexSpec were generalized in Graph it could be used for traversal methods as well. The general pattern for VertexSpec is name (map) {...}. This could also be used in traversal methods such as preorder. preorder A (colors) {...}.

NameSpec

When a property is missing from Graph a NameSpec should be returned. This will be used in the dsl to replace strings. Strings are not returned to prevent type issues and confusion.

ConfigSpec

When a method is missing in Graph a ConfigSpec` will be returned. This class should only contain a map and closure. The map will always contain an entry for name which contains the name of the missing method. Name can be overriden if the missing method is passed a map. The closure is what ever actions to take for the method.

Replacing VertexNameSpec

NameSpec will replace VertexNameSpec. This should be a drop in replacement.

graph.A returns a NameSpec with name == 'A'.

Using ConfigSpec with VertexSpec

When a vertex method is called and passed a ConfigSpec the method will need to convert it to a VertexSpec.

Using ConfigSpec with traversals

A traversal can take a root name, a map of colors and an action closure. Using a ConfigSpec with these methods would look like this.

graph {
    breadthFirst A (colors) {
        println it.name
    }
}
@moaxcp
Copy link
Owner Author

moaxcp commented Jul 22, 2017

ConfigSpec

@moaxcp moaxcp changed the title Generalize VertexSpec Create NameSpec and ConfigSpec Jul 23, 2017
@moaxcp moaxcp added this to Feature in 1.0 Aug 4, 2017
@moaxcp moaxcp closed this as completed Aug 20, 2017
@moaxcp moaxcp moved this from Feature to Develop in 1.0 Aug 20, 2017
@moaxcp moaxcp moved this from Develop to Release in 1.0 Aug 20, 2017
@moaxcp moaxcp moved this from Release to Done in 1.0 Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
1.0
Done
Development

No branches or pull requests

1 participant