Java Design Patterns Language

Software Programming Design patterns – Does Template method need to be in an Abstract class?
Programming language – Java
I’ve got a class with a method which its algorithm i do not want to change.
I make that method final so the method can’t change or overriden.
Does this count as a template method?
No. Sorry it does not. In Template Method, the base class has an algorithm, which is broken into steps. The steps are private abstract methods so that derived classes can provide the details.
Consider a “Happy Meal” It’s algorithm is an entree, side order, drink and toy. The entree could be burger, cheese burger or chicken nuggets. The side could be fries, apple slices or cookie. The toy varies ever week.
The “Happy Meal” algorithm never changes, but it’s implementation may.
State Design Pattern