Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Design Pattern & UML  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:Decorator and Proxy 的区别 [Re:MoutainHigh]
njluz





发贴: 18
积分: 0
于 2005-07-08 14:11 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我感觉的理解模式,只看实现方式可能不能完全理解模式,楼主说的两个模式在实现上看起来其实真的很象,提一个细小差别,Decorator中包含对接口类型(Interface)的Reference,Proxy包括的是对实做(Implement Class)的Reference.
模式的使用有一个环境,目的,从这方面理解并且结合实现方式可能会更好理解模式.
Decorator目的将额外的责任动态的附加在对象上,不必演生新的子类及可弹性扩充功能,例如为文本编辑器添加边框,添加scrollbar,而不影响文本编辑器本身
Proxy目的替其他对象预留代理的空位,借此控制存取其他对象,例如图象等大对象的延迟载入,Remote Proxy,权限代理,智能型代理.
另外GoF的Design Pattern写的很好,建议详细阅读.




话题树型展开
人气 标题 作者 字数 发贴时间
23777 Decorator and Proxy 的区别 MoutainHigh 103 2005-03-25 17:15
17179 Re:Decorator and Proxy 的区别 jigsaw 166 2005-03-28 14:09
16997 Re:Decorator and Proxy 的区别 jameszhang 222 2005-06-25 22:28
19412 Re:Decorator and Proxy 的区别 MoutainHigh 91 2005-03-29 11:27
17199 Re:Decorator and Proxy 的区别 hitaco 101 2005-05-24 15:55
17460 Re:Decorator and Proxy 的区别 dissip 385 2005-04-13 17:24
17241 Re:Decorator and Proxy 的区别 popplelee 39 2005-04-16 21:02
17599 Re:Decorator and Proxy 的区别 njluz 362 2005-07-08 14:11
18044 Re:Decorator and Proxy 的区别 ranchgirl 405 2005-12-19 01:12

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923