Synchronization is unreadable and error-prone #74
Labels
1.0 release
Issues to fix before 1.0 release
code quality
Improvements w.r.t. readability of code & best practices of coding
feature
New feature or request
Milestone
I think my attempt of synchronizing the attributes of the
ipsi
andcontra
instances in theBilateral
model class are bad: It's hard to understand what's going on, the state of some objects changes "magically", one cannot even look up what is synchronized, and I am loosing my mind over it.However, I think there may be simpler and more elegant solution: A
SynchronizerMixing
, in a similar fashion to theDelegatorMixin
: Such a mixin class could dynamically create methods and properties that keep e.g. someipsi
andcontra
attributes in sync. The advantage would be that the entire synchronization is now the responsibility of theBilateral
(orMidline
) class. Theipsi
andcontra
objects would - on their own - still work as expected and not leak anything to each other via obscure synchronization callbacks.This could be much easier to test, as well.
The text was updated successfully, but these errors were encountered: