473,765 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

design patterns

how apply design patterns to c ?
Mar 1 '06 #1
12 4713

Jean-pierre Martineau schrieb:
how apply design patterns to c ?


First you have to switch to C++,
haven't you?

Mar 1 '06 #2

Zero wrote:
Jean-pierre Martineau schrieb:
how apply design patterns to c ?


First you have to switch to C++,
haven't you?


Not necessarily. It is possible to do OO in C as well. Some of the
early C++ compilers were actully just producing C code for the
underlying C compiler.

This, however, still does not make the OP topical here. The
comp.programmin g group might be a better place to start.

--
BR, Vladimir

Mar 1 '06 #3
use #include<graphi cs.h>
with the help of pre definedfunction s you get required graphics
there will also be examples given in help menu

Mar 1 '06 #4
use #include<graphi cs.h>
with the help of pre definedfunction s you get required graphics
there will also be examples given in help menu

Mar 1 '06 #5
use #include<graphi cs.h>
with the help of pre definedfunction s you get required graphics
there will also be examples given in help menu

Mar 1 '06 #6

srikanth wrote:
use #include<graphi cs.h>
with the help of pre definedfunction s you get required graphics
there will also be examples given in help menu


LoL

--
BR, Vladimir

Mar 1 '06 #7
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 ?
Mar 1 '06 #8
Jean-pierre Martineau 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 ?


Yes, OO in C can be done that way. The simplest way to represent an
object in C is to add appropriate function pointers to a struct.

--
Ian Collins.
Mar 1 '06 #9

"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
Mar 2 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
674
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of generic design patterns that can be used and shared amongst many sub-schemas. For example, the grouping of entities. I may have the following tables: employee, product and client. These tables have no direct relationship with each other. But...
1
2374
by: Jay | last post by:
The GOF text is widely considered the definitive book on the topic. Design Patterns: Elements of Reusable Object-Oriented Softare, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides Note, all the examples are in C++ but you can get through them with a little work.
1
1887
by: Josh28 | last post by:
Hi We are a group of two chaps just out of undergrad, we created a software to automate the use of Design Patterns. We have put it up at Source Forge--http://dpatoolkit.sourceforge.net/ The software has been designed using the .NET framework and coded in C#. The patterns can be stored as plug-ins in XML, adding any number of attributes like Intent, Behavior and the like... Class
13
6561
by: John Salerno | last post by:
Here are a few I'm considering: Design Patterns Explained : A New Perspective on Object-Oriented Design (2nd Edition) (Software Patterns Series) by Alan Shalloway Design Patterns C# by Steven John Metsker Design Patterns by Erich Gamma Head First Design Patterns by Elisabeth Freeman
2
2606
by: Carlo Stonebanks | last post by:
I have the infamous GoF Design Patterns boo - it's been sittin gon my shelf for years. I have a huge reading list and find this book a rather dry read and am always putting it off. I have recommendation for "Head First Design Patterns" book, but it's aimed aimed at Java developers. I'd rather have a book that has a "For Dummies" readability that that hopefully exploits C# and .NET features and (oh, please, please, please) includes a CD...
22
4740
by: Krivenok Dmitry | last post by:
Hello All! I am trying to implement my own Design Patterns Library. I have read the following documentation about Observer Pattern: 1) Design Patterns by GoF Classic description of Observer. Also describes implementation via ChangeManager (Mediator + Singleton) 2) Pattern hatching by John Vlissides Describes Observer's implementation via Visitor Design Pattern. 3) Design Patterns Explained by Alan Shalloway and James Trott
5
2375
by: Ludwig Wittgenstein | last post by:
Other than the Design Patterns book, which book(s) is/are the best to learn object-oriented software design/architecture from ?
7
3105
by: =?Utf-8?B?bWF2cmlja18xMDE=?= | last post by:
Hi, I would like to know more about design patterns and specifically using C#. Can any one recommend a good book? Thanks
5
2747
by: macca | last post by:
Hi, I'm looking for a good book on PHP design patterns for a OOP beginner - Reccommendations please? Thanks Paul
10
3677
by: vital | last post by:
Hi, I am designing the middle tier of a project. It has 6 classes and microsoft application data access block. The six classes are DBServices, Logger, ProjectServices ... etc. and all these classes talk to front-end directly. Do I need to use any design pattern in this? or what kind of design pattern is this?
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.