quinta-feira, 15 de agosto de 2013

Strategy design pattern

Hello,

I have to say that I'm working around design patterns since about two years ago. I think I know more that average but still long way to go.. So the best thing to do is to climb on the giant's shoulders :)

I spend a lot of time with books no so good as these 3:

So if you are think to study design pattern, make the right move choosing the right book.

But books is a long way plan let's understand strategy design in the next 15 minutes! 
Two months ago, my friend gave me this link click here (11:32). I found it a great resource to understand design patterns quick.

After the great above video - very well explained in "how to use" and "why" point of view.

Image from wikipedia


I will add one more drawback of this design pattern that is not mentioned in the video: 
  • The strategy interface is shared between all concrete strategy. So we have to be careful with our concrete, to not make some concrete strategy that doesn't need to do any action of strategy interface, in order to not violate Interface Segregation Principle.
Cheers.

Sem comentários:

Enviar um comentário