-
Notifications
You must be signed in to change notification settings - Fork 426
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
Settings: Reduce complexity and tight coupling #2659
Labels
Comments
MattHag
changed the title
Settings: Reduce complexity and dependencies
Settings: Refactor code to reduce complexity and dependencies
Nov 4, 2024
MattHag
changed the title
Settings: Refactor code to reduce complexity and dependencies
Settings: Reduce complexity and tight coupling
Dec 31, 2024
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Dec 31, 2024
Replace tight coupling of classes by converting their common base class into a simple function, that is used instead. This change completely removes the RuleComponent class. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Dec 31, 2024
Replace tight coupling of classes by converting their common base class into a simple function, that is used instead. This change completely removes the RuleComponent class. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Dec 31, 2024
Convert the base classes into protocols to decouple all related classes from each other, while still enforcing a common interface. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Dec 31, 2024
Convert the base classes into protocols to decouple all related classes from each other, while still enforcing a common interface. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Replace tight coupling of Action and Condition classes by removing their common base class and converting it into a function. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Enforce a common interface for all Action and Condition related classes and connect them to a common protocol class to support isinstance checks. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Replace tight coupling of Action and Condition classes by removing their common base class and converting it into a function. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Enforce a common interface for all Action and Condition related classes and connect them to a common protocol class to support isinstance checks. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Replace tight coupling of Action and Condition classes by removing their common base class and converting it into a function. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Enforce a common interface for all Action and Condition related classes and connect them to a common protocol class to support isinstance checks. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Replace tight coupling of Action and Condition classes by removing their common base class and converting it into a function. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Enforce a common interface for all Action and Condition related classes and connect them to a common protocol class to support isinstance checks. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Replace tight coupling of Action and Condition classes by removing their common base class and converting it into a function. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Enforce a common interface for all Action and Condition related classes and connect them to a common protocol class to support isinstance checks. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Replace tight coupling of Action and Condition classes by removing their common base class and converting it into a function. The RuleComponent was a base class solely holding a compile function and passing it to its children. There is no need for tight coupling with inheritance for that purpose. Related pwr-Solaar#2659
MattHag
added a commit
to MattHag/Solaar
that referenced
this issue
Jan 2, 2025
Enforce a common interface for all Action and Condition related classes and connect them to a common protocol class to support isinstance checks. Related pwr-Solaar#2659
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Setting class in logitech_receiver/settings contains dozens of subclasses, which are expected to contain specific properties. However, that's not ensured via implementation and makes it so hard to reafactor and maintain.
A dependency graph for the logitech_receiver module can be created via pyreverse
The diagram shows an unbelievable amount of tightly coupled classes with multiple inheritance levels. This makes it very hard to test, refactor and improve related code.
The problems are
Necessary actions
Replace inheritance with composition, e.g. the RuleComponent is only a function. There's no need to inherit 100 classes from it, rather convert it into a function.
Information
The text was updated successfully, but these errors were encountered: