Quote:
|
I like having the method for comparing the objects as part of the object.
|
This by now quite a standard in OO techniques. No need to know Java, C++ or any OO-paradigm-able language.
By using this method you'll be able to make more generic classes, and therefore loosening up the coupling between the various classes.
A recent member (grid) in the C++ forum accepted a challenge. The issue I just mentioned will play a role. After this weekend (most likely) I'll demonstrate the code.
Another method one could use is to be found in
design patterns. If you are familiar with the
template method pattern and/or
strategy pattern, then see if it fits sde's needs. It will be one heck of elegant and OO-based solution. Note that the
sorting machine doesn't have to know what it is sorting.