-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Generate dependency graph for all objects in application container #80
Comments
After discussion with @solnic we decided to create a graph of all registered dependencies in dry-system. Also, we want to provide public API for working with this graph. It’ll allow using Our strategic product goals now: build GUI graph for dependencies, detect unused keys and calculate heat map. ImplementationWe want to use After that, we want to create plugins for GUI, unused keys and etc. Schematically it can look like this. In dry-event we subscribe on something that happen in dry-system (registered, joined and called): After that we can build a directed graph with weight for edges: Current state and TODOdry-events and monitoring
dry-system dependency graph
|
This looks like an exciting development, @davydovanton! Mind if I ask a few questions? I'm sure many of these might've been clear to those of you chatting in person, but it might help for people like me, following from afar and perhaps interested in helping. (1) Firstly, is the goal of this to be able to get the dependency graph simply from booting the system? Or will it need the system to actually be run and exercised in order to generate the graph? (i.e. have actual web requests run over it, in the case of a web app) (2) Would you mind explaining a bit more what you meant here?
Thanks! I'll be following this closely and will try to help where I can! |
@timriley thanks for questions! Really love it 👏 (1) I hope we will able to detect nodes/edges after call (2) Forgot to update comment and link this PR - dry-rb/dry-auto_inject#59 |
The current state of the feature: We merged notifications to dry-system #113 and create a simple WIP project https://github.com/dry-rb/dry-system-dependency_graph. And now working on building and working with the dependency graph. Generated dependency graph for repository example: |
Since the initial dependency_graph plugin is already implemented, I'm closing this issue. |
I created a simple proof of concept for generation graph of all dependencies in container: link to gist file.
For this I used "custom" auto_inject register for creating
included_keys
class method with all dependencies.After that I detect all classes with this method and generate "AST" with associations between classes.
With this changes we can detect unused dependencies in container, build GUI graph for easily understand system (like UML diagrams) and ect.
We can start build something like this for dry-system, WDYT? I can create a simple plan with small steps for this feature if you want.
The text was updated successfully, but these errors were encountered: