I am preparing talk about general architecture of Zend Framework
, and wanted to summarize Design Patterns used in it.
I believe it will be beneficial both for those knowing ZF
and learning DP
s, and for those knowing DP
s and learning ZF
. In a former case, one would be able to see real-world application of patterns, and get a better comprehension of framework in the second.
Even brief answers in a form Zend_Contoller_Front: Singleton
are good enough, if a little elaboration is provided (for some not-so-obvious cases) it will be even better.
I am primary interested in GoF
patterns, as they seem to be the starting point of any DP-adventure.
UPD: Not directly related, but for those who know Java
there's extremely complete answer for GoF
's DP
examples found in Java
core.
To provide a sample of what I want, and to help those who suspect I am asking others to do my leg-work evaluate better whether answers to this question might be helpful to someone else (either trying to learn DPs or ZF), here is sample:
Factory Method Pattern:
Since this is a CW now, I'll add the patterns I already gave in the comments:
Zend_Controller_Front
Singleton
FrontController
Zend_Db_Table
Table Data Gateway
Zend_Log
Factory Method
Adapter
Composite
Zend_Form
Composite
Decorators
Zend_Filter
andZend_Validator
Strategy
To name some patterns:
Zend_Controller_Front
(index.php + .htaccess)Zend_Registry
Zend_Application_Bootstrap_Bootstrap
's containergrep getInstance
)Zend_Form
's validatorsZend_Form
's decorators| grep adapter
File and method names are obvious, so
grep
is your friend.Any volunteer to edit and provide the links and sample code?
For completeness, one should note that Zend_Form uses a modified decorator pattern. In Zend_Form, the generated content is decorated and not the object itself.
Source: http://devzone.zend.com/1240/decorators-with-zend_form/