Zend front controller and getInstance()

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Zend front controller and getInstance()

Post by Christopher »

Theory? wrote:How does Skeleton handle it by default?
1) Everything accessed via the Registry, 2) there is a separate class that holds/calculates the paths and names for Actions, etc. to use (so no dependency on the FC object at all), and 3) the Registry object is injected into Action constructors/methods so no static calls required. It makes it lighter and everything replaceable, but that is it own set of design trade-offs -- hence the arguments about the lack of concrete interfaces, etc. You just can't win design discussions. ;)
(#10850)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Zend front controller and getInstance()

Post by josh »

arborint wrote:. You just can't win design discussions. ;)
Exactly, I could argue that its so simple to replace the static call in the ZF context with an object registry, its the temptation static calls gives you to design bad that is the danger, you've just gone out of your way to do what most are too lazy to do. Even so the FC should still be a singleton, not a Singleton tho ( or the other way around, you get my point ). http://www.thekua.com/atwork/2009/01/si ... -instance/ sums it up concisely
Post Reply