Template / Theme Design

Welcome To Template / Theme Design

In the template method of this design pattern, one or more algorithm steps can be overridden by subclasses to allow differing behaviors while ensuring that the overarching algorithm is still followed.

In object-oriented programming, a concrete class is created that provides the steps of an algorithm design. Steps that are considered invariant are implemented inside the base class. The steps that are considered to be variant, are given a default implementation or none at all. These variant steps must be supplied by concrete derived subclasses. Thus the general algorithm is saved in one place but the concrete steps may be changed by the subclasses.

The template method pattern thus manages the larger picture of task semantics, and more refined implementation details of selection and sequence of methods. This larger picture calls abstract and non-abstract methods for the task at hand. The non-abstract methods are completely controlled by the template method, but the abstract methods, implemented in subclasses, provide the pattern's expressive power and degree of freedom. Template method's abstract class may also define hook methods that may be overridden by subclasses.


Theming refers to "the use of an overarching theme...to create a holistic and integrated spatial organization of a consumer venue.It is also the subject of discourse, discussion, meditation and composition. In an overall sense, theming can be categorized under either experience; what an individual sees and feels in their current ‘themed environment’ or décor; which is utilized to make an individual remember something through the portrayal of the theme, whether it be generic or specific.

The concept's creation has been attributed to Mark Gottdiener work, first published in 2000 (in particular his book New forms of consumption: Consumers, culture and commodification), and further developed in 2001 (The Theming of America: dreams, media fantasies, and themed environments).

The most common purpose of theming is to make an event memorable, though theming can also be a means to create a niche. It can be thought of as a method to narrow down a broad event or aspect. A holidaycan be, in a sense, generalized as a theme. ChristmasEasterValentine’s DayIndependence Day, are all celebrated themes. In this case, the themes mentioned would be derived from history. However, themes are not limited to just that; many themes come from different cultures and fantasy. A prime example of a fantasy theme would be from the famously known books series called Harry Potter by author J.K. Rowling. By using major aspects of the book in order to create a themed party, one is using a fantasy theme since the books are works of fiction. Nevertheless, theming is not limited solely as a means of characterizing.

Theming can vary in intensity from gatherings such as birthday parties, to interior design, to entire architecture based on a particular theme, with theme parks like Disneyland being an example of a common large-scale application of theming. Theming is prevalent in certain casinosmuseumsairports and resorts. More often than not, restaurants prevail in this area. An example of a 'themed restaurant' would be Magic Restroom Cafe in Los Angeles, California. Customers of this restaurant are served their meals in miniature toilet bowls and are seated on toilet seats in order to obtain the full dining experience. The use of theming is used extensively through the events industry and comprises modules at many universities including the UK Centre for Events Management at Leeds Metropolitan University. Theming is usually used to portray a notable experience by taking aspects of the past and integrating them into original ideas and/or extravagant events. It can also be seen as a creative medium used to attract attention or embellish an otherwise ‘plain’ event.

Some or all of the abstract methods can be specialized in a subclass, allowing the writer of the subclass to provide particular behavior with minimal modifications to the larger semantics. The template method (that is non-abstract) remains unchanged in this pattern, ensuring that the subordinate non-abstract methods and abstract methods are called in the originally intended sequence.

The template method pattern occurs frequently, at least in its simplest case, where a method calls only one abstract method when using object oriented languages. If a software writer uses a polymorphic method at all, this design pattern may be a rather natural consequence. This is because a method calling an abstract or polymorphic function is simply the reason for being of the abstract or polymorphic method. The template method pattern may be used to add immediate present value to the software or with a vision to enhancements in the future.

Ready to Get started ?

Messag to