Zend Framework中使用的设计模式

Vic*_*agi 21 php oop design-patterns zend-framework

我正在准备谈论一般架构Zend Framework,并想总结其中使用的设计模式.

我相信这将是既为那些有利于了解ZF和学习DPS,并为那些知道DPS和学习ZF.在前者的情况下,人们将能够看到真实世界的模式应用,并在第二个获得框架的更好的理解.

在窗体即使短暂的答案Zend_Contoller_Front: Singleton是不够好,如果提供一点点的阐述(对于一些不那么明显的情况下),它会更好.

我主要对GoF模式感兴趣,因为它们似乎是任何DP冒险的起点.

UPD:没有直接关系,但对于那些谁知道Java非常完整的答案GoFDP中发现的例子Java核心.

Gor*_*don 15

由于这是CW现在,我将添加我在评论中已经给出的模式:

  • Zend_Controller_Front
    • Singleton
    • FrontController
  • Zend_Db_Table
    • Table Data Gateway
  • Zend_Log
    • Factory Method
    • Adapter
    • Composite
  • Zend_Form
    • Composite
    • Decorators
  • Zend_FilterZend_Validator
    • Strategy


tak*_*hin 14

列举一些模式:

  • 前控制器模式Zend_Controller_Front(index.php + .htaccess)
  • 注册表模式 Zend_Registry
  • Zend_Application_Bootstrap_Bootstrap容器中的依赖注入
  • 单身人士(中grep getInstance)
  • 策略模式Zend_Form的验证者
  • 在装饰图案Zend_Form的装饰
  • 适配器模式 | grep adapter

文件和方法名称很明显,grep你的朋友也是如此.

是否有志愿者编辑并提供链接和示例代码?