You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Circular references in objects structure is bad practice for many reasons. The worst result of this practice is a God-object anti-pattern. We actually have a whole Trinity of God-objects in LaunchManyCore, Session, and DownloadManager.
These anti-patterns significantly complicate mocking, reduce testing efficiency, and prevent us from achieving a truly modular design, that is the first step to the microservice architecture.
In general, functions/methods should never extract information from its arguments. For example, we want the class __init__ arguments list to represent the minimal set of things that this class requires to be instantiated and do its thing.
We are already going to refactor the libtorrent wrapper, so this is a suitable moment to add this rule of no parent referencing to Tribler coding standards.
The text was updated successfully, but these errors were encountered:
Circular references in objects structure is bad practice for many reasons. The worst result of this practice is a God-object anti-pattern. We actually have a whole Trinity of God-objects in LaunchManyCore, Session, and DownloadManager.
These anti-patterns significantly complicate mocking, reduce testing efficiency, and prevent us from achieving a truly modular design, that is the first step to the microservice architecture.
In general, functions/methods should never extract information from its arguments. For example, we want the class
__init__
arguments list to represent the minimal set of things that this class requires to be instantiated and do its thing.In short, we must refactor code like this:
to
We are already going to refactor the libtorrent wrapper, so this is a suitable moment to add this rule of no parent referencing to Tribler coding standards.
The text was updated successfully, but these errors were encountered: