面向对象系统分析与设计_装饰器模式.ppt
《面向对象系统分析与设计_装饰器模式.ppt》由会员分享,可在线阅读,更多相关《面向对象系统分析与设计_装饰器模式.ppt(19页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、06 一月 2023Neusoft Computer Science and Technology Department copy right1OO System Analysis&Design【The Decorator Pattern】06 一月 2023Neusoft Computer Science and Technology Department copy right2Enjoy coffee06 一月 2023Neusoft Computer Science and Technology Department copy right3Our job is:lTo help Star
2、buzz Coffee Caf to update their ordering system.06 一月 2023Neusoft Computer Science and Technology Department copy right4The goal is tolCompute the cost of the beverage;lGive the description of the beverage;06 一月 2023Neusoft Computer Science and Technology Department copy right5Coffee with layers06 一
3、月 2023Neusoft Computer Science and Technology Department copy right6Starbuzz CoffeelCoffeeslHouse Blend$0.89lDark Roast$0.99lDecaf$1.05lEspresso$1.99lCondimentslSteamed Milk$0.10lMocha$0.20lSoy$0.15lWhip$0.1006 一月 2023Neusoft Computer Science and Technology Department copy right7Class diagram:BaseoB
4、everage是所有饮料的基类;cost()是抽象方法,所有子类都需要定义它们自己的cost()实现来返回特定饮料的价钱;description变量也是在子类里赋值的,表示特定饮料的描述信息,getDescription()方法可以返这个描述。06 一月 2023Neusoft Computer Science and Technology Department copy right806 一月 2023Neusoft Computer Science and Technology Department copy right9o除了咖啡以为,还提供丰富的调味品,比如:炼乳、巧克力、砂糖、牛奶等
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 面向 对象 系统分析 设计 装饰 模式
限制150内