Consider also not modeling the Group explicitly, and only having the Element class, with the operations mul and exp defined on it (might internally call to some helper function, or consult a table or something). Then for a derivative, a correct implementation would be required to implement mul according to group axioms (associativity, unique identity element, inverse element for every element). This avoids having parallel hierarchies, and would probably make things much easier.
↧