March 5th, 2010, 8:15 am
This is an off remark, but related to how any system is built. OOP is one of the paradigms for designing software systems; there are other, equally viable ones. Instead of always ISA (inheritance) you *also* use HAS-A (composition, delegation) which is even better in my experience. I am not going to start ranting again, but inheritance is neither necessary nor sufficient for flexible code. It is difficult to maintain and can be wrong (e.g. SQUARE ISA RECTANGLE ) QuoteCan you give some examples or keywords on how to improve the designIn C++, I find these to be useful:1. boost::Function (interface programming)2. template template parameters (ball and socket architecture), implements this3. boost::Signals (events)Most developers are comfortable with OOP and find templates (especially compiler errors) somewhat intimidating. Most experienced developers I talk to say that GP and non-OOP leads to easier s/w.. Look at Java and C# if you need convincing which way the wind is blowing here is an example of a generic nested class, with smart pointers and where the implelmentation is customisable. *Using* it just implies GenericComposite<double, vector> ==> write once, clone many times. No more inheritance, nor _copy_and_paste_
Last edited by
Cuchulainn on March 4th, 2010, 11:00 pm, edited 1 time in total.