Design Patterns: Template Method

Play Design Patterns: Template Method

The Discussion

  • User profile image

    Excellent discussion but volume is too low

  • User profile image

    Head First is a great book, easy to read and leads the reader through the thinking process. However, some patterns are significantly simplified in modern C#.

  • User profile image

    To comment on something Robert said: I would say that abstract classes can appear to be the Template Method pattern, but rather can implement the pattern for one of its methods. The Template Method (hence the name) is specific to the fact that you have a particular method that defines an algorithm with parts of the algorithm can be delegated to an implementer/override. Where an abstract class doesn't necessarily define an algorithm in of itself, it defines an object with state and behavior. Also different from strategy pattern, where it tries to focus on allowing an entire implementation of an algorithm to vary from one implementation to another (quick sort, bubble sort), and does not care about the algorithms structure.

    Great video, but I felt that it could have better been described as different from other patterns by focusing on the fact that the pattern is really for a method that defines an algorithm, where abstract classes are just one mechanism for facilitating that.

    The series is great, should do more content like this. Developers really need to know this stuff.

  • User profile image

    I thought this series was a great idea and I like the Phil and Rob but I found the repeated use of the Pizza example eventually confusing bc each example was different in a nuanced way. What I wanted to come away from each video was being able to describe the pattern and apply to an example rather than remember a specific code example. To me the concept is better than remembering an example.

    The decorator pattern, well Phil could have his Bike shop problem to show us how that could have been tackled. Another example could have used the credit card project he talked about.

Add Your 2 Cents