码迷,mamicode.com
首页 > 其他好文 > 详细

Decorator Design Pattern

时间:2019-07-26 19:15:02      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:provides   original   des   amp   ora   struct   which   tac   nali   

Decorator pattern allows a user to add new functionality to an existing object without altering its structure.

This type of design pattern comes under structural pattern.

This pattern creates a decorator class which wraps the original class and provides additonal functionality keeping class methods signature intact.

Below diagram and code is an example of the Decorator Design Pattern.

 技术图片

Decorator Design Pattern

标签:provides   original   des   amp   ora   struct   which   tac   nali   

原文地址:https://www.cnblogs.com/codingyangmao/p/11252131.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!