/designPatterns

most used design patterns implemtations example

Primary LanguageJava

design patterns implemtations:

test

  • the examples below are tested in DesignPatternApplicationTests.java

adapter

example: adapting bird to squeak

builder

example: building Book object

composite

example: managing tree of articles

decorator

example: adding condiments to beverage with costs

facade

example: computer facade that manage CPU calculating, HDD reading and Memory loading

factory

example: factory that create object shape by type

proxy

example: restrict access to image method: "display"

singleton

example: creating a cache singleton example

strategy

example: adding diffrent type of bonus to employee

visitor

example: delegating calcul of yealy employees bonus to visitor