Again classes, multiple inheritance, one base class

Started by
12 comments, last by skwee 16 years, 10 months ago
Quote:Original post by s.kwee
So in this case I made a fool of myself.
And yes English is not my native language.
So that I want to apologize about my mistake.


No worries.

Quote:
rip-off
Every word of every post is important, if it wasn't people wouldn't post it.


Not really. Its quite easy to make a mistake or to word something wrong. I often edit my posts quite a few times before I'm happy enough with the wording (but I'm just unusual).

Some other people you may meet on your journey just have what some would describe as an "aggressive" or "abrasive" style. But it's nothing personal, these people just have a straightforward manner.

Just to note, jpetrie is not one who I would consider to have such a style...

Personally, while I may not enjoy it at the time I would rather be put in my place harshly by someone and come out of it smarter than treated nicely and go off doing something stupid with regards to my programs design.

Advertisement
Quote:Original post by s.kwee
So in this case I made a fool of myself.


Only in the eyes of those who don't know the difficulties of learning a new language :).
Just as an aside s.kwee...

learn the concept of "Design To An Interface".

This means, (in C++), create a single base class for each set of responsibilities... one per set... which should remain abstract and which should have all the member functions you need (virtual).

Then create one more level of heirarchy for the concrete classes, derived from your base classes. This creates only two levels of heirarchy, which is inherently less coupled than a long inheritance tree.

Once you're practiced and proficient at that... you can blend templates, policy classes, design patterns and whatever best fits your problem domain with this simple idea of an "interface first".

Discard the idea that every "object" should derive from a single base Object. That was a flawed idea from the early days of OOD. Inheritance is not the strongest suit of OOD.


Good luck!
my_life:          nop          jmp my_life
[ Keep track of your TDD cycle using "The Death Star" ] [ Verge Video Editor Support Forums ] [ Principles of Verg-o-nomics ] [ "t00t-orials" ]
MaulingMonkey
Thanks for support :)

Verg
Thanks you! I got you're idea and I'll read the article.

I would love to change the world, but they won’t give me the source code.

This topic is closed to new replies.

Advertisement