WHAT'S HOT
Prev | Current Page 378 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

2.2. The static functions set() and get()
Licensed to Menshu You
Zend Framework in Action (Ch01) Manning Publications Co. 61
need to perform the same actions and so set called offsetSet() to set an item into the registry (#2) and offsetGet
is used to retrieve an item from the registry(#3).
Note that by using offsetGet/Set, the code is oblivious of the underlying storage mechanism used to hold
the items. This future-proofing allows for the storage mechanism to be changed if required and this code will
not need to be updated.
We??™ve looked at two of the common design patterns used in web applications and as I??™ve said, there are
many others. The Zend Framework itself implements more too and so is a good code-base for studying them.
Other patterns in use include:
Model-View-Controller in the Zend_Controller family of functions
Table Gateway in Zend_Db_Table
Row Gateway in Zend_Db_Table_Row
Strategy in Zend_Layout_Controller_Action_Helper_Layout
Observer in Zend_XmlRpc_Server_Fault
There are a lot of patterns out there and I recommend a read of Patterns of Enterprise Application Architecture
by Martin Fowler and php|architect??™s Guide to PHP Design Patterns by Jason Sweat for further information
on many of the common web-oriented patterns.


Pages:
366 367 368 369 370 371 372 373 374 375 376 377 378 379
ubezpieczenia mieszkania do wynajęcia Abs mafia poradnik betsson