design patterns in c

  • Thread starter Jean-pierre Martineau
  • Start date
J

Jean-pierre Martineau

how implement 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 ?
 
P

Phlip

Jean-pierre Martineau said:
how implement 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.

This group discusses C++. You will find more people familiar with advanced C
style if you post to .

I cross-posted and set the followup to there.

It would seem the important part of design patterns (and of all OO) is
polymorphism. Inheritance and encapsulation are just a framework to
polymorph in.

Classical C polymorphism uses function pointers. So a pattern like Abstract
Template would set a function pointer for each specialized method that the
generic method calls.

This technique is usually called a "callback", and is very common, so OO in
C is probably already very popular.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top