What Big Advantages Do You Use The Zend Framework For?

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

Post Reply
supermike
Forum Contributor
Posts: 193
Joined: Tue Feb 28, 2006 8:30 pm
Location: Somewhere in the Desert, USA

What Big Advantages Do You Use The Zend Framework For?

Post by supermike »

What big advantages do you use the Zend Framework for? I'm trying to decide whether I need to learn it or not.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Re: What Big Advantages Do You Use The Zend Framework For?

Post by Maugrim_The_Reaper »

I don't want to write stuff that everyone else and their dog has written previously and given away for free. All I really want to write an application - not the nuts and bolts that drive it.

That's really the biggest advantage of any framework though.

For the ZF specifically, it's largely than it's a non-glued component library where I can replace key components with my preferred alternatives. For example, typically I really do not like Zend_Db. I prefer a full ORM or DataMapper implementation instead. So I just don't use Zend_Db. Or I could replace Zend_View with Smarty. Also the ZF decoupling and detailed API makes customised components easier to implement using a few subclasses.

In short, it's flexible.
supermike
Forum Contributor
Posts: 193
Joined: Tue Feb 28, 2006 8:30 pm
Location: Somewhere in the Desert, USA

Re: What Big Advantages Do You Use The Zend Framework For?

Post by supermike »

I've spoken to two established PHP freelancers and they were not using ZF and did not plan to do so. They said they'd prefer to not take that contract than to spend time learning ZF or to increase the footprint and slow down the speed of their project. One of the big arguments I heard for ZF from them was that they said it might have a good impact for those working in teams, but they didn't see for much else. Now, there are probably those who would think the exact opposite, but I wanted to share this.

Some argue that the reason they use ZF is because they came from a Ruby on Rails environment and it's in their mind that ZF gives them a Rails or J2EE type of toolkit. I also often hear, "I don't like PHP's mix of presentation and business logic." Of course, many of those who make the presentation layer argument, whom I have contacted, have never even considered Smarty PHP, oddly enough. I use Smarty on all my projects and love it.

So, for now, I'm going to stay the course and avoid ZF. I'll have a smaller project footprint, the website will run a little faster, and because I use Smarty, I'll have separation of PHP logic and presentation. Most of my clients are not interested in ZF -- most want inexpensive "starter" websites that sort of scale okay, were knocked out rapidly but not to the point of spaghetti code, and which they then can come back to me to add more features or speed up certain parts later on down the road.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Re: What Big Advantages Do You Use The Zend Framework For?

Post by Maugrim_The_Reaper »

I often just say your mileage will vary. PHP is often given the rub because it's total lack of structure by default - Ruby is the same, except everyone doing a web app in Ruby will almost inevitably use Rails or merb.

The problem with adopting a framework is that it demands a new way of thinking - you must commit to Object Oriented programming, you almost certainly must understand the meaning of Model and Domain Modelling, and you may even understand why many PHP developers recently are turning their back on Smarty.

There is a difference between splitting presentation from business logic, and splitting presentation logic from business logic. Pure PHP is simply more flexible than Smarty and more programmable (possibly to the detriment of designers - it's not entirely flawless!).

As for footprint - it borders on a myth than a well rounded framework will add a massive slowdown. Caching, opcode caches, and performance testing are often sufficient when used properly to minimise the footprint to acceptable levels. The worst footprint offenders are those who complain about the size of a framework (which has no relation to performace whatsoever unless the app is actually including all those files).

I also believe strongly, that every developer does use a framework ;). They may say learning the ZF is not going to happen while merrily plugging away at their custom framework in the background. If they don't have a framework - are they reinventing authorisation every project from scratch?

Finally, it's not a glued up framework - it's also a component library of high quality PHP5 components. There is tons of useful libraries in there which are not stamped MVC :).
Post Reply