- Setup gradle project:
gradle init --type java-library
strategy
: Implementation of duck behavior usingstrategy pattern
.observer
: Implementation of publish subscribe model.decorator
: Implementation of beverage class usingdecorator pattern
. Wrapping up beverage type during run time.factory
: Implement a pizza store. A pizza factory which prepares variety of pizza.singleton
: An implmentation of singleton class to create unique instance.command
: On/Off remote control implementation using command pattern.adapter
: An adapter which adapts an enumeration to an iterator.template
: A class representing components of template pattern. There are different ways to implment this, only generic representation is shown.iterator
: Iterator implementation for aggregate types like Array, Map etc. Different types of data structure encapuslated internal implementation by implmenting an iterator.composite
: Implement tree structure print to demonstrate composition.