Christian Vest Hansen schreef: > Staying with on puristic object oriented topic, there is no > "inheriting into", there is only "inheriting from". > > When class Bicycle inherits from class Transportation, you essentially > say that Bicycle is-a [kind of] Transportation. Sounds very much like the Car derived from Vehicle example you'll get in an awfully large amount of textbooks. And yes you're right it is "to inherit from" (added "to verb origin" from a puristic linguistical point of view ;-) ) > Usually, when this is-a relationship dosn't hold true, then a > composition pattern is often the right way of doing things. > > For instance, a Car is not a kind of Engine even though both can be > start() 'ed. Instead, a Car contains an Engine and Car.start() would, > at least at some point, redeligate the call to Engine.start(). True the only thing is that a sound source (the way as it is defined by the OpenAL specs) really is an object with a position, velocity and orientation in space (as is a listener). > While a SoundSource might be a point in time and space, I don't think > it fully lives up to everything that makes up a complete Vertex > (having lookud up the defenition of 'Vertex' on Google define). > > And SoundListener sounds like an interface to me, but I don't know if C++ > even have interfaces. Erm, I'm not sure how java "interfaces" look like but class inheritance with virtual functions in C++ is basically meant to do just that: provide interfaces. > PS. this all comes from my Java background, so if C++ see things > diferently... oh well :-) Well I don't know how Java does all of this so I can't know whether it's different there. Though I'm guessing the design philosophy of Java on this particular part (i.e. classes as interfaces or not) is quite different from C++'s design philosophy.
Description: OpenPGP digital signature
_______________________________________________ Warzone-dev mailing list Warzoneemail@example.com https://mail.gna.org/listinfo/warzone-dev