项目作者: kpilszak

项目描述 :
Project shows a simple usage of decorator pattern
高级语言: Java
项目地址: git://github.com/kpilszak/decorator-pattern-coffee.git
创建时间: 2019-01-08T11:54:32Z
项目社区:https://github.com/kpilszak/decorator-pattern-coffee

开源协议:

下载


Decorator Pattern Coffee


Table of contents

General info

This project shows usage of decorator pattern.
The main principle is “Classes should be open for extension but closed for modification”.
Decorators allow user to attach additional responsibilities to an object dynamically.
We define a component class which is extended by concrete component classes and decorator class.
Decorator class is extended by concrete decorators’ classes in which we have a reference to component class.

Technologies

Project is created with:

  • Java
    IDE: Intellij IDEA 2018

Setup

To run this project, you need to have jdk and jre installed.
Download the src folder and open it in a command prompt or terminal.
Type javac StarbuzzCoffee.java and press enter to compile.
Type java StarbuzzCoffee to run program.

Sources

This project was created as an exercise from Eric Freeman, Elisabeth Freeman, Bert Bates and Kathy Sierra book “Head First. Wzorce projektowe”.