[LC++]Generic programming vs OO inheritance

Roberto Diaz rdiazmartin at vivaldi.dhis.org
Fri Aug 17 02:53:00 UTC 2001


> > Well.. I think you can use generic programing instead of polimorphic code
> > only when your code is desingned so all can be done by static-binding then
> > it makes more sense to do generic-programing but if you can avoid dynamic
> > binding I cant see how can be posible to resolve all with templates.
> Could you give me a (hopefully simple) example of when you can't avoid
> dynamic binding?

Imagine you are coding a server which loads objects contained in a .dso
file based upon demands of its clients.. the server can not to know what
kind of object it needs *after* the client has asked for a particular
service.. How to avoid here dynamic binding?

But I agree that a golden rule must be "avoid dynamic binding as much as
possible and templatized as much as you can".


Regards

Roberto

------------------------------------------------------------------------
Roberto Diaz <rdiazmartin at vivaldi.dhis.org>
http://vivaldi.dhis.org
Powered by GNU running on a Linux kernel.
Powered by Debian (The real wonder)

Concerto Grosso Op. 3/8 A minor
Antonio Vivaldi (so... do you need beautiful words?)
------------------------------------------------------------------------




More information about the tuxCPProgramming mailing list