Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Can you recommend a fews websites that you think are doing the best job exemplifying (in C# or in C++) the use "Gang of Four" design patterns.

The top sites from Google are (they are always on top of the search results when I try to search by a pattern's name):

www.dofactory.com sourcemaking.com/design_patterns

but examples I found on these sites are too boring (who in their right mind would use a class name like a "ConcreteBuilder2" to set up the example??)

So if you know a website with a good/realistic/easy to understand and remember examples of GoF design patterns - please share here.

Thank you.

share|improve this question
5  
If you want high quality interesting material then buy a book Head First Design Patterns <--Cleverly written to be interesting and stick with you. Examples are in Java, but it isn't hard for a C# guy to read. Don't be a cheapskate – P.Brian.Mackey Oct 31 '11 at 15:13
1  
And don't bother with C# 3.0 Design Patterns - which I gave up on a third of the way in, as it just wasn't as useful or engaging as Head First Design Patterns proved to be. – Mark Booth Oct 31 '11 at 15:22
1  
Great presentation by Jim Coplien on the foundations of patterns oredev.org/2010/sessions/pattern-foundations – Carlo Kuip Oct 31 '11 at 15:43
The Gang of Four didn't present very good patterns. – DeadMG Oct 31 '11 at 16:51
1  
@DeadMG: That's just not correct at all. A couple aren't terribly useful, but many of them (at least 2/3) are good patterns that appear in every major piece of software. – Steve Evers Oct 31 '11 at 17:19
show 1 more comment

4 Answers

up vote 2 down vote accepted

For C++ - try this site:

http://sourcemaking.com/design_patterns

Also, if you ever read Head First Design Patterns book they provide links to ported examples in C# and C++ under 'Book code and downloads':

http://headfirstlabs.com/books/hfdp/

share|improve this answer

I recommend http://www.pluralsight-training.net/microsoft/ . It's not free, but you can get a 10 day free trial. Their design pattern videos are really good. They also have some C++ courses.

PS Just to clarify - I dont work for this company. This is just my personal experience.

share|improve this answer

You've already read Head First Design Patterns, you've already seen the examples presented on dofactory and sourcemaking and I'm going to assume you've already read the GoF book - or at least seen the wikipedia pages for each GoF pattern.

That should be plenty sufficient. If it's not, you might want to try just implementing the patterns in contrived sample applications to get your head around what they do, how they do it, why they are useful and what their failings are.

Failing that, you might want to go back a bit and grab some learning material for object oriented programming/design.

share|improve this answer
"plenty sufficient" for what? What sort of assumptions are you trying to make? Yes I have read HFDP and seen dotfactory/sourcemaking and I read GoF book cover to cover ... more than 10 years ago ... in two languages ... This is why I am asking about "best examples", not examples I can find just by clicking a "google search" button once. – user18404 Nov 3 '11 at 12:51
1  
@Andrew: I'm making the assumption that you're trying to learn (or re-learn) the GoF patterns. They're not rocket surgery. If the "simplistic" examples on the sites you've already seen/been recommended to, aren't enough then maybe you should consider re- reading HFDP and the GoF book. The best examples will be the ones you write yourself. – Steve Evers Nov 3 '11 at 13:10

I've always liked/referred to the dofactory. It has the canonical examples plus "real world" examples. The optimized code samples require you to buy their book or something (which I haven't) but if you know .NET well enough, it's not a huge leap to write it yourself.

share|improve this answer
Haa... I was about to suggest that website. dofactory is a really good reference. – Jean-Philippe Leclerc Oct 31 '11 at 17:03
I have mentioned dotfactory and sourcemaking in my question already ... They are both good (the first been around for a while), but the examples on both sites are quite simplistic and hardly could be called "real world" ones. If these two sites are actially the best - than this is is very sad... – user18404 Nov 2 '11 at 11:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.