Design Patterns

Started by
39 comments, last by Baraclese 20 years, 6 months ago
I''m curious as to what design patterns you have found useful to apply in your game engine. And what patterns should a game programmer look into and learn?
Advertisement
abstract factory pattern
singleton pattern
template pattern
*checks the contents page from GoF)

Singleton
Pluggable factory (and, thus, factory)
Template
Visitor
Composite
Memento
Observer
State/Strategy


Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4
ry. .ibu cy. .abu ry. dy. "sy. .ubu py. .ebu ry. py. .ibu gy." fy. .ibu ny. .ebu

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

client/server

Anything else is waste of time or poor programming skills.

Edit:
Also insert fancyname et al + pattern and scheme/ocaml/lisp and the size of your e-penis will turn exponential.

[edited by - Captian Goatse on October 11, 2003 1:05:14 PM]
quote:Original post by Captian Goatse
client/server

Anything else is waste of time or poor programming skills.

Thats a rather narrowminded and reactionary view.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
I fancy factory and interface a whole lot. Typically, interfaces will be expressed as pure virtual classes in header files; concrete implementations go into one source file per class, including the class declaration of the concrete class at the top of the .cpp file.

Others that are nice include asynchronous queuing patterns (FIFO, workers and callbacks), systems/services, visitors (great for traversing scene graphs!), model/view/controller, and generic property trees.
enum Bool { True, False, FileNotFound };
Personally I use the Abstract Factory (very cool and easy and useful), the all beloved Singleton, I don''t know if "Interface" is actually a design pattern, but I use it too.
I haven''t gotten around yet on using Typelists with the Abstract Factory as described in "Modern C++ Design", it takes some time to grasp what is going on there. Template metaprogramming can make your head smoke

What''s a template pattern? Just using templates or what? I''d like to see some code that enlightens me about the Visitor pattern.

Baraclese
quote:Original post by Captian Goatse
client/server

That''s not a design pattern...

quote:
Anything else is waste of time or poor programming skills.

I think you''ve misunderstood what a design pattern is. How exactly does using a common solution to a frequent problem make you a poor programmer?



Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Enginuity1 | Enginuity2 | Enginuity3 | Enginuity4
ry. .ibu cy. .abu ry. dy. "sy. .ubu py. .ebu ry. py. .ibu gy." fy. .ibu ny. .ebu

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Captian Goatse you obviously either misinterpreted exactly what a design pattern is, or your a complete idiot.

Any object orientated programmer worth his salt knows and uses tried and tested design patterns.

If your not yet sold, buy this book:

http://www.amazon.com/exec/obidos/tg/detail/-/0201633612/qid=1065914435/sr=8-2/ref=sr_8_2/102-3614532-0849762?v=glance&s=books&n=507846

You could definitely learn from it.
-jonnii=========jon@voodooextreme.comwww.voodooextreme.com
I have the book Design Patterns by the father of the singleton pattern. Anyhow, I''ve yet to see where design patterns actually help me.

I''ve not met a language that would force me to use singleton and if there is a language that is so incapable that I can''t brute force, I won''t use the language. As simple as that.

"Design patterns" are waste of time. It is cool if you get excited with them and they might be a nice hobby, but they are nothing practical.

Ok, I might have accidentally used some other design pattern, but common sense people!!

Common sense and pragmatic programming; no time wasted.

And please don''t call me an idiot if I don''t follow the modern trends.

This topic is closed to new replies.

Advertisement