Re: C++ design/over desiging : stl style vs OOPS, OOAD
On 9/20/2011 12:09 PM, persres@googlemail.com wrote:
Hello,
I am a bit confused about so many design approaches to even the
simplest of problems. I am not able work with all of them together. It
seems I have to pick one of these.
Mainly there seems a distinct choice between the two.
1. The new generic programming way. All this stl algorithms, range
functions, transforms, generates and function objects etc. (This is
my favourite for fun).
2. The object oriented, polymorphic, way. Say the trolltech QT
framework. You really wouldn;t be approaching with style1 if you were
to design something like QT. I guess.
When do you do what. Can I say that if its a computation/algorithmic
problem we are solving- style 1. If it is one of software design -
style2. Is that true?
[...]
I prefer the stl kind of approach. It seems so different from the old
style oops. What are your thoughts?
There is a place and time for everything. The Standard Library
mechanisms are there to allow you not to re-implement low-level data
structures and parts of your algorithms. Once you move above your low
level, you're usually faced with higher abstractions that do require OOD
(along with OOA). The approach involving OOA/OOD is essential for
keeping your system extendable. Policies and other generic stuff are
there to help you manage concepts at any level, AIUI.
Have you leafed though the "Multi-paradigm design for C++" by Coplien?
Get a copy and give it a good read, you won't be disappointed. And
don't mind the fact that it's more than 10 years old.
Good luck!
V
--
I do not respond to top-posted replies, please don't ask