"Jean-pierre Martineau" <jpmart@dev.ath.cena.fr> wrote[color=blue]
> Jean-pierre Martineau a écrit :[color=green]
> > how apply design patterns to c ?[/color]
> 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 ?
>[/color]
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