11
Shouts

kny#: The template method pattern

published 844 days, 1 hour, 10 minutes ago posted by http://kennyeliasson.myopenid.com/http://kennyeliasson.myopenid.com/ 847 days, 2 hours, 32 minutes ago
Monday, February 01, 2010 1:44:24 PM GMT Friday, January 29, 2010 12:21:57 PM GMT

One of my favorite patterns is the "Template method pattern".

Basically its about having a abstract class that defines common behaviour with points that can be customizable.

Yesterday I was refactoring alot of classes tha't didn't make use of the template pattern, but they all inherited from the same base-class. The base-class acted more like a common place for methods that all objects needed.

Let me show you some code that I had before the refactoring.

public class QuestionQuery : QueryBui...

category: ASP.NET | clicked: 0 | | source: knysharp.blogspot.com | show counter code
tags: Template Pattern, Design Pattern, C#