O'Reilly logo

Pro Objective-C Design Patterns for iOS by Carlo Chung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 18. Template Method

As in cooking, there are certain steps that can be generalized in common procedures, such as preparing ingredients, cooking the ingredients, and serving the dish. An actual recipe can vary within the scope of each of the steps. For a particular type of food, steps to take can be even further generalized. For example, there are common steps to make a sandwich, no matter what type it is. Each type of sandwich can vary by the type of bread that will be used, the type of meat that will be put in the bread, as well as condiments. Some sandwiches might be a little bit different from a generic sandwich, with some extra steps, but still basically follow the common steps to prepare.

A group of generalized steps (a recipe) to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required