-
Notifications
You must be signed in to change notification settings - Fork 7
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
Complex #7
Comments
Thanks for your interest in the project. Cheers... |
Hehe, I think it is acceptable to compare it to a BMW ;) You're doing a great job and I'm honored if we can collaborate to simplify it. Ofcourse, without losing its power. Also thank you for responding this quickly. I think it is better to discuss the complexity in this thread, instead of the wiki. My primary concern with the current approach are the generics, which seems to be a bit on steroids. I do reckon the power of a generic structure like this, but I have a few suggestion in making them more readable. I don't know if there are feasible, but I'll write them down anyhow.
3a. I think we should have a more consistent naming. InMemoryGraph should be named PropertyGraph? Do note that some suggestions might be my lack of understanding, please feel free to correct me. Cheers, Michel |
Hi, Given the Test Driven Design approach, would it be possible to identify what the ideal usage API looks like (and still contain all the functionalities) and after that, implement the thing piece by piece? In my view the usage API should be really simple, clean and straightforward.. so one without any knowledge of graphs can failry easy pickup the libraries and start using them right away. If you look at the original Java implementation of Blueprints, it's a really clean API... perhaps it's possible to leverage some of their interfaces and convert their generic structure to C#? Cheers! |
Yes, generics are steroids, but they are a great tool for the compiler, intellicence and the developer to write better code faster (see Anders Hejlsberg's talk on C# 5.0 at the last BUILD). I have some none-standard property graphs running in production having not a <String, Object> typing, but are backed by enums, so we can have a strong typed property graph which is really awesome ;) (…at least for me ;) ) We could also define simplified interfaces, if this might clear things. But you have to account that this will lead to a problem with inheritance. If you have the following: Nearly the same problem occurs with the GenericGraph and PropertyGraph interfaces. Sure the PropertyGraph interface is more or less just a generic graph having KeyValuePairs on vertices and edges. BUT as in a graph everything references everything else the problem is that you have to decide which type to return when you traverse the graph. If graph.Vertices() would return a generic vertex you would have to do a cast when you want to access the properties of a property vertex. What we would need is unfortunately at the moment not possible with C#. Even with co- and contravariance we cannot change the return type of methods so that the IPropertyGraph interface will return IPropertyVertices instead of IGenericVertices but is still derived from the the IGenericVertices interface. The problem with the naming is 100% true. With respect to the Boost Graph library I want to support multiple graph representations (Adjacencylist) beside the pure class-based graphs of Tinkerpop. Currently there is e.g. some proof-of-concept code within Blueprints.NET which stores a graph as (RDF-)Quads. Another important thing will be 100% read-only property graph interfaces and implementations as this will allow us to do amazing things on multicore cpus ;) I hope this might give a short glimpse on the resons for some decisions I made. |
Yes the talk with Anders was good, wasn't it. A colleague of mine attended the conference, and pointed it to me. I've managed to discuss the complexity with some colleagues as well. (Un)fortunately we all think your solution is still the best. Other solution will mean loss of type safety and flexibility. So the generics are of the refactoring todo list. I do think it is still wise to write some wiki pages explaining the complex stuff, because it is scary to look at first :) I do think we should relocate some classes though, for the sake of discoverability and overview. My idea would be to relocate the GenericGraph and InMemoryGraph project content to the Blueprints project, in a folder "Implementations". I would also opt for the convention to default the implementations to in-memory ones. So THE PropertyGraph would default mean an in-memory one. This way the following implementations would hold:
Eventually, I can image, we create graphs for other than in-memory, like Neo4j, OrientDB, DEX, etc. IMO these should go in new projects, and could be based on any of the graph interfaces inside the blueprints project. |
Hi Achim,
I'm trying to use blueprints.net, but I find it rather hard to understand what is going on.
I'd really like to use it, but it seems rather overengineered, and I might think other people would have to agree.
Is there any way to keep it flexible, but easier to use/understand?
Regards,
Michel
The text was updated successfully, but these errors were encountered: