Design Patterns: Template Method

Sign in to queue

The Discussion

  • User profile image
    danny

    Excellent discussion but volume is too low

  • User profile image
    Gru

    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
    DeadX07

    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.

Add Your 2 Cents