国外技术干货:GDD_pydp_python_design_patterns

VIP免费
2025-03-28 0 0 4.18MB 46 页 5.9玖币
侵权投诉
Copyright ©2007, Google Inc
Design Patterns in Python
Alex Martelli (aleax@google.com)
http://www.aleax.it/gdd_pydp.pdf
The "levels" of this talk
2
Shu
Ha
Ri
Py
DP
("Retain")
("Detach")
("Transcend")
Hit the ground running...
3
"Forces": some rich,
complex subsystem
offers a lot of useful
functionality; client
code interacts with
several parts of this
functionality in a way
that's "out of control"
this causes many
problems for client-code
programmers AND
subsystem ones too
(complexity + rigidity)
Solution: the "Facade" DP
4
interpose a simpler
"Facade" object/class
exposing a controlled
subset of functionality
client code now calls
into the Facade, only
the Facade implements
its simpler functionality
via calls into the rich,
complex subsystem
subsystem implementation
gains flexibility
, clients gain simplicity
© 2004 AB Strakt 17 STRAKT
DP "Facade"
!existing supplier code ! provides rich,
complex functionality in protocol S
!we need a simpler "subset" C of S
!facade code " implements and supplies C
(by calling S on !)
Facade is a Design Pattern
summary of a frequent design problem +
structure of a solution to that problem (+
pros and cons, alternatives, ...), and:
A NAME (much easier to retain/discuss!)
"descriptions of communicating objects and
classes customized to solve a general design
problem in a particular context"
that's NOT: a data structure, algorithm,
domain-specific system architecture,
programming-language/library feature
MUST be studied in a language's context!
MUST supply Known Uses ("KU")
5
摘要:

Copyright©2007,GoogleIncDesignPatternsinPythonAlexMartelli(aleax@google.com)http://www.aleax.it/gdd_pydp.pdfThe"levels"ofthistalk2ShuHaRiPyDP("Retain")("Detach")("Transcend")Hitthegroundrunning...3"Forces":somerich,complexsubsystemoffersalotofusefulfunctionality;clientcodeinteractswithseveralpartsof...

展开>> 收起<<
国外技术干货:GDD_pydp_python_design_patterns.pdf

共46页,预览5页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:5.9玖币 属性:46 页 大小:4.18MB 格式:PDF 时间:2025-03-28

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 46
客服
关注