Strategy Pattern

I finally got a chance this week to finish a screen-cast on the strategy pattern. I’d been planning on doing this way back in December but life’s been rather hectic since then.

Anyhow here it is: Strategy Video 

Pattern Summary

  • The Strategy pattern defines a family of algorithms, encapsulates each one and makes them interchangeable.Strategy lets the algorithm vary independently from clients that use it.

Design Principles applied:

  • Identify the aspects of your application that vary and separate them from what stays the same
  • Program to a super-type (interface/abstract class), not to a concrete implementation
  • Favour composition over inheritance

This video attempts to explain the strategy pattern. Apologies if it causes any confusion; this is my first attempt at presenting; criticism will be appreciated 🙂 If it does leave you confused please post a comment and maybe I can improve on it in the future.

‘The most dangerous strategy is to jump a chasm in two leaps’ 

From feedback received, it was clear that applying polymorphism to specify the ‘Play Music’ behavior has led to some confusion. Even though the individual felt they understood polymorphism, I think they had never seen it used in conjunction with an interface. Therefore I done a quick 5 minute video discussing polymorphism.

Object-Orientated Design Principles & Patterns

I was planning on doing a series of blogs about OO design patterns. It certainly is a hot topic in our offices with many differences of opinion on how you should implement software. 

My aim here is highlight the patterns I’ve discovered (in a 2nd hand sense :p) for other developers new to object orientated best practices.

The communication media most preferred now seems to be video; (I suppose most people would rather watch a presentation than read the presenters book) so I’m attempting to produce a few screen-casts covering OO patterns and principles. I intend them to be for beginners.

Here’s a list of books that interested me:

Head First Design Patterns Eric Freeman & Elisabeth Freeman

I found this a very good beginners guide that explains the patterns really well but also the repercussion of not applying good OO principles.

Design Patterns: Elements of Object-Orientated Software – Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides

Excellent as a piece of work: hard going for the beginner. Now that I’ve learnt the principles and patterns I can quickly make use of the formal definitions in this book. But I personally don’t believe its the book to sell patterns to a non-believer. But it is a brilliant collection 🙂

Patterns of Enterprise Application Architecture – Martin Fowler

Taking things a step further with more specific patterns and best practices for the realm of enterprise applications

If my videos make you wish you’d become a painter then please comment with some constructive criticism and I’ll try and improve my presentation style 🙂 That’s partly my reason for creating the videos.

 

Hello

Welcome to my blog. I thought I’d introduce myself and the contents of this blog. This is my first experiment at blogging.  I imagine this blog will remain a place for me to discuss ideas rather than my daily activities.

I am a software developer working for Black Marble in Bradford,  UK.  I plan this blog to be relatively technical in the spirit of all thing programmer-related.

My motivation is only to share ideas with my fellow colleague’s. If you don’t know me then I pray not to sound arrogant, ignorant or foolish. If you do know me then..its too late, I’m not listening to you, I know I’m right 🙂

I must admit now I’m writing I feel a little uneasy with the concept of releasing my thoughts onto T’internet. Generally, I only have three thoughts and only one to discuss on a work blog server without fear of being fired 🙂

But we’ll see how it goes…