I am learning design patterns from the Head first design patterns book. The book has mostly toy examples, but sometimes they mention real world examples of usage of a design pattern. For example, the Decorator pattern is used in Java's Input Stream class to read from files, strings etc. Unfortunately, the book don't always mention real examples of where a design pattern is used. So, I was looking for a list or catalog which lists all design patterns and examples of its use in any open source project.
Do you know if such a catalog exists ? If not, then please add any examples that you know of so that a complete list can be built.
Decorator pattern usage - java.io.InputStream
Photo - link.
Observer pattern - ?
Strategy pattern - ?
etc...
Thanks!
PS - I prefer to NOT use the Gang of four/GOF book as an example because it does not use Java and you have to learn a lot about the application the authors use in their examples. I'd like to use isolated examples like the InputStream one.
Aucun commentaire:
Enregistrer un commentaire