Please make graphs and graph builders public and non-final
See original GitHub issueGreat library!
I’d like to extend a graph class so as to replace the huge type name it generates with a shorter one more germane to my usage. When a graph gets built, it’s type name is something like MutableValueGraph<SourceElement, SourceRelationship>
whereas I’d like to extend it with a class called SourceGraph
…much better! The graph builder classes don’t allow changes to build a custom graph unless you’re happy re-inventing the wheel so it’s a case of copy-paste the code just to use the shorter name or use the huge name everywhere.
If the classes were extendable my use case would be very easy.
If there’s a good reason not to I don’t know it and would love to hear it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Mockito cannot mock this class - java - Stack Overflow
My class was public and non-final. This did the trick. ... It's about 'Tells Mockito to create the mocks based on the @Mock...
Read more >Write Safer User-Defined Functions & Procedures with ... - Neo4j
Fields annotated with @Context must be public and non-final. All other fields in the class must be static. If the type of @Context...
Read more >Using Insight builder to create data insights
Insight builder helps you to analyze your survey or project data in illustrative charts and graphs that are easy-on-the-eye, and can be shared...
Read more >TinkerPop3 Documentation - Apache TinkerPop
The primary way in which graphs are processed are via graph traversals. The TinkerPop3 process API is focused on allowing users to create...
Read more >The Examination Process - Found Persuasive
Once the patent application is published, it is available to the public and can also be ... The Examiner will issue either (1)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Extending classes to provide
typedef
-like functionality usually doesn’t go well: As soon as you call a method liketransitiveClosure
, you have aGraph
that isn’t of the right type anymore.You could consider creating a
SourceGraph
type that contains an instance ofMutableValueGraph<SourceElement, SourceRelationship>
, but of course then you either need to copy the methods you’re interested in or else refer tosourceGraph.theActualGraph.someMethod()
.(That said,
MutableValueGraph
is an interface, so I think you could create a subtype of that if you wanted. That doesn’t help with types likeImmutableGraph
, but we’d want to be especially careful in letting anyone subclass those, since people might break immutability guarantees.)Damn… I guess, I should get more sleep. 😉