Thursday, 24 December 2009

Design Patterns

Hi Readers,

It was high time to publish this post. A long time ago I decided to implement all the design patterns are in the famous GOF book: Design Patterns: Elements of Reusable Object-Oriented Software
Why? Because doing it by yourself the most efficient learning method. At least, for me. When I read this book first, I thought, know everything. All patterns made sense. But after time I realized using those patterns in practice are _REALLY_ hard. If you don't see what are the scopes, what object has access to what other objects, etc ... means you won't use it efficiently. Although, I'm still not confident with a lot of pattern. And by the way, I think it's not the best book for introducing these patterns. I found Wiki pages more useful in a lot of cases.

Here you are the downloadable JAVA sources:

[Disclaimer: these are my interpretations. Don't take it for sure. My understanding sometimes like a 1 month old pig's ass.]

Download ChainOfResponsibility pattern (BehavioralPatterns)

Download Command pattern (BehavioralPatterns)

Download Interpreter pattern (BehavioralPatterns)

Download Iterator pattern (BehavioralPatterns)

Download Mediator pattern (BehavioralPatterns)

Download Memento pattern (BehavioralPatterns)

Download Observer pattern (BehavioralPatterns)

Download State pattern (BehavioralPatterns)

Download Strategy pattern (BehavioralPatterns)

Download Template pattern (BehavioralPatterns)

Download Visitor pattern (BehavioralPatterns)

Download Adapter pattern (StructuralPatterns)

Download Bridge pattern (StructuralPatterns)

Download Composite pattern (StructuralPatterns)

Download Decorator pattern (StructuralPatterns)

Download Facade pattern (StructuralPatterns)

Download Flyweight pattern (StructuralPatterns)

Download Proxy pattern (StructuralPatterns)

Download AbstractFactory pattern (CreationalPatterns)

Download Builder pattern (CreationalPatterns)

Download FactoryMethod pattern (CreationalPatterns)

Download Prototype pattern (CreationalPatterns)

Download Singleton pattern (CreationalPatterns)

If you find any mistake, please let me know. I want to fix them. Thanks.

Happy Holidays,
Peter

Ps.: And this is the small shell script I packed the source folders:
for dir in BehavioralPatterns StructuralPatterns CreationalPatterns
do
for pattern in `ls $dir`
do
tar -czf $pattern.tar.gz ./$dir/$pattern
echo "Download $pattern pattern ($dir)
"
done
done

No comments:

Post a Comment