"Jean-pierre Martineau" <jp****@dev.ath .cena.fr> wrote
Jean-pierre Martineau a écrit : how apply design patterns to c ?
the question was not very clear, i rewrite:
how implément design pattern in style of object oriented programming > in
c ?
I think it could be simulate Object oriented by subtitute heritance style
by agregation style.
what you think about that ?
Really you are using the wrong language.
You can design some really elaborate schemes using C, like a function called
"void *queryinterface (Object *obj, char *name)", which returns a structure
full of function pointers implementing the given interface, given that the
object supports it. So a car might implement the "container" , "moveable" and
"light source" interfaces.
However it soon gets very unwieldy. You really want a language that will
hide the internal operations for you behind some intutive syntax.
--
Buy my book 12 Common Atheist Arguments (refuted)
$1.25 download or $6.90 paper, available
www.lulu.com