Programming question of the week ;)

M-.-n EMAIL HIDDEN
Tue Apr 14 21:54:06 CEST 2009


Also, while I'm at it, it's a typical 'beginner' to try to share as much as
possible through inheritance. In your case, it's going to be more work to
inherit all of your class from Item to get a title property than one
stuffing one in each of them. Unless your high level application *needs* to
deal with them as the same thing (which doesn't seem to be the way so far),
don't try to do it "because you can". It's the functionality that drives the
design before all.

Hope this helps.
M. 

-----Original Message-----
From: music-bar-bounces at lists.music-bar.org
[mailto:music-bar-bounces at lists.music-bar.org] On Behalf Of M-.-n
Sent: mardi 14 avril 2009 21:50
To: 'Music-bar'
Subject: RE: Programming question of the week ;)



Do a list of CD *. Because you don't have more than one type of object so
far ;)

It is not because your Classes share functionality & properties that you
have to store those all in the same place as being the same thing. Do a
separate container for each of your classes derived from Item. 

See the inheritance process more to share functionalities and, at the high
level, treat each individual class as what it is.

M.

>How do you solve this? It doesn't make sense to do virtual function s 
>in class Item for every possible set-get function in the children
classes.


_______________________________________________
music-bar mailing list
music-bar at lists.music-bar.org
http://lists.music-bar.org/cgi-bin/mailman/listinfo/music-bar




More information about the music-bar mailing list