Skip to Content.
Sympa Menu

patterns-discussion - Re: [patterns-discussion] how to implement design patterns using c language

patterns-discussion AT lists.siebelschool.illinois.edu

Subject: General talk about software patterns

List archive

Re: [patterns-discussion] how to implement design patterns using c language


Chronological Thread 
  • From: mark AT graybill.com
  • To: patterns-discussion AT cs.uiuc.edu
  • Subject: Re: [patterns-discussion] how to implement design patterns using c language
  • Date: Wed, 03 May 2006 06:17:52 -0600
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/patterns-discussion>
  • List-id: General talk about software patterns <patterns-discussion.cs.uiuc.edu>

In short, you cannot implement many OO design patterns in C because it lacks the fundamental OO capability of abstraction/inheritance.  Otherwise, you can fake some OO-like programming using structures and function pointers.  I wouldn't recommend it however.  What embedded platform (hardware and OS) is being used?  What sort of performance and determinism is required? 

I recommend looking up Embedded C++ (there is a standard a brewing), and perhaps consider one of the embedded C++ compilers (hate to suggest Greenhill's compiler because it is unnecessarily expensive, but it is fairly reliable).  Between Embedded C++ and say Greenhill, I think you can do a fairly decent job of implementing OO design using patterns (using C++) while not sacrificing performance - even maintaining some degree of determinism.

The C++ compilers have matured quite nicely, and so if designed well-enough, a C++ alternative to C can perform as well - but C++ done right can handle complexity better than C and so could prevent spaghetti and convoluted C code, leading to savings on resource usage, maintenance and even performance. 

Also, there are some C-like tricks you can do with C++ now that you couldn't do (with confidence) 5 years ago.  Such tricks can save on space and improve performance over their OOP alternatives. 

If you might need an expert to come in, I recommend Scott Meyers and associates (he has people that don't have his high profile and so are not as expensive, but they are up to snuff with his material.)

I also recommend "Pattern Hatching" by Vlissides.

Hope this helps.

Cheers!
Mark



----- Original Message -----
From: "Li Xinyi"
To: patterns-discussion AT cs.uiuc.edu
Subject: [patterns-discussion] how to implement design patterns using c language
Date: Fri, 28 Apr 2006 10:15:28 +0800

Hi, guys

I am new to design patterns, and just start to learn it by picking up the book, head first design patterns.
I worked for an embedded software company. Unfortuantely here I dont have any object oriented programming language available.
I am wondering, is there any resource explaining how to implement the design patterns using c language.

Best Regards,
Ryan

_______________________________________________
patterns-discussion mailing list
patterns-discussion AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/patterns-discussion



  • Re: [patterns-discussion] how to implement design patterns using c language, mark, 05/03/2006

Archive powered by MHonArc 2.6.16.

Top of Page