Tag Archive: design patterns

Dec 07

Design patterns: compound patterns

Next chapter is quite complex. Literally complex. And I treat it as a last chapter of the book since it is a last chapter when you learn a new design pattern in a detailed way. And the last one of them is quite popular in many PHP frameworks. It is called MVC (Model-View-Controller). Maybe this …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2014/12/07/design-patterns-compound-patterns/

Jan 31

Design patterns: proxy


New 2014 year did not start easy for me in terms of describing new design pattern I have learnt by reading the book. The cause of it is next chapter I have read more than a month ago. It describes new proxy pattern but it describes it mostly in Java environment. However, it does not …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2014/01/31/design-patterns-proxy/

Dec 29

Design patterns: state

gumball machine flow

It’s about the time to put another design pattern post on my blog. This time I’ll write about state design pattern about which I read in the book. State pattern helps objects to control their behavior by changing their internal state. I also learnt it’s really similar to the first pattern in the book which …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/12/29/design-patterns-state/

Nov 19

Design patterns: composite

Composite pattern's diagram

While describing iterator pattern on previous post I mentioned it was a part of a bigger chapter in the Head First: Design Patterns book. The second design pattern described in the chapter is called composite. The composite pattern helps us create tree structures in our code. The book example this time is pretty straight-forward but …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/11/19/design-patterns-composite/

Oct 14

Design patterns: iterator

iterator design pattern's diagram

Next chapter in the book is the longest one. But I will split it into two posts because it’s about two design patterns. The first one’s name is: iterator and it was mentioned at least once before. I recall it while describing examples of adapter pattern usage. The iterator pattern, unlike other design patterns, helps …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/10/14/design-patterns-iterator/

Sep 22

Design patterns: template method

client and facade design pattern in terms of the principle of least knowledge

Chapter eight of the book is about template method pattern. It’s another way of encapsulation. The examples shows how to encapsulate piece of algorithms so the sub-classes can hook themselves right into computation any time they want. We learn a new design principle too! Book example First example is a real one from real life! …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/09/22/design-patterns-template-method/

Aug 31

Design patterns: facade

a home theater system class hierarchy

The adapter pattern mentioned in previous post was only one of two design patterns mentioned in seventh chapter in the book. When you continue the reading you’ll find interesting discussion between a decorator and an adapter. It leads to the conclusion that both of these two design patterns seem to look similar on a paper …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/08/31/design-patterns-facade/

Jul 27

Design patterns: adapter

Adapter pattern diagram from Head First: Design Patterns

This time I’m writing about adapter pattern. This is an easy one to understand. Why? Because our world is full of real-life adapters. The authors of the book gives just this simple example about AC power adapter. We use it while traveling from Europe to United States because we want our laptops work there. So, …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/07/27/design-patterns-adapter/

Jun 30

Design patterns: command

Command pattern diagram from Head First: Design Patterns

This month I’m writting about command pattern. This is another design pattern which helps us decoupling some actions in similar way to strategy pattern. To be more specific it makes us able to encapsulate method invocation. The last word made me thinking of PHP unit tests while reading — but I’ll get back to it …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/06/30/design-patterns-command/

May 25

Design patterns: singleton

This month I’d like to write about singleton pattern and tell you how it’s described in Head First: Design Patterns book. This chapter was one of the shortest in the book, so far. I read it a while ago and wanted to post about it earlier but as always… lack of free time didn’t let …

Continue reading »

Permanent link to this article: https://blog.lukaszewski.it/2013/05/25/design-patterns-singleton/

Older posts «