question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Please make graphs and graph builders public and non-final

See original GitHub issue

Great 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:closed
  • Created 5 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
cpovirkcommented, Jun 25, 2018

Extending classes to provide typedef-like functionality usually doesn’t go well: As soon as you call a method like transitiveClosure, you have a Graph that isn’t of the right type anymore.

You could consider creating a SourceGraph type that contains an instance of MutableValueGraph<SourceElement, SourceRelationship>, but of course then you either need to copy the methods you’re interested in or else refer to sourceGraph.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 like ImmutableGraph, but we’d want to be especially careful in letting anyone subclass those, since people might break immutability guarantees.)

1reaction
Maaartinuscommented, Jul 4, 2018

Damn… I guess, I should get more sleep. 😉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found