With the goal of maximizing code reuse, I have created a rather complex class hierarchy for my Python code. It goes something like this:
class ElectionMethod
class IterativeMethod
class SNTV
...
class NonIterativeMethod
class OrderDependent
class CambridgeSTV
...
class OrderIndependent
class WIGM
class ERS97STV
...
class Recursive
class MeekSTV
...
Only the leaves of the class hierarchy are ever instantiated into objects. This does serve its purpose of maximizing code reuse, but the code itself is complicated (some classes have 20 or so methods) and given the many levels it can be time consuming to find where something is implemented.
I've tried pulling out chunks of functionality and putting that functionality in a separate object, but I haven't found a good way to do this since nearly all the functionality depends on common data. I.e., I can move some code to a different object but it needs to refer back to the big complex hierarchy to get the data it needs so it isn't really encapsulation.
Does anyone have any advice as to how to make this more manageable?