Skip to main content

Posts

Showing posts with the label template method pattern

Behavioral Patterns : Template Method

Properties: -            Abstract class defines steps to achieve some task. At some points it defers actions to subclasses.   -            Common steps are done within abstract class so code repetition is avoided. -            Subclasses defines subclass specific steps. Implementation: -            AbstractClass  defines template method in which generic algorithm is formed. At subclass specific points abstract mehods are called to defer specific tasks to subclasses. -            ConcreteClass  extends abstract class and defines abstract methods to implement tasks in a specific way to it. Java Standard Library Implementations: -            java....