Mid GoF Patterns

Template Method (Cook):?

  • The Cook method in the Recipe class defines the skeleton of the algorithm.

It calls GatherIngredients, Prepare, CookMethod, and Serve in a fixed

order. The first three steps are abstract and need to be implemented by

subclasses, while the Serve method is concrete and always works the same

way.

More from Design Patterns in C#

All questions for this course