Tomato6966 / lavalink-client

Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.
https://tomato6966.github.io/lavalink-client/
MIT License
61 stars 22 forks source link

feat: remove circular reference/dependency #53

Open NedcloarBR opened 2 months ago

NedcloarBR commented 2 months ago

LavalinkManager has NodeManager and ManagerUtils that need LavalinkManager to be instantiated but the LavalinkManager property is public so we have the circular reference/dependency problem.

LavalinkManager.NodeManager.LavalinkManager.ManagerUtils.LavalinkManager

And it goes on endlessly. In this Issue I suggest that the LavalinkManager be private within classes that are its properties

Tomato6966 commented 2 months ago

making something private doesn'T solve circular references

I will think of how to reduce the circular references

appujet commented 2 months ago

You can do

Dependency Injection After Instantiation

Or Lazy Initialization