Page 1 of 1
Should I use a framework?
Posted: Wed Nov 28, 2007 2:30 am
by Mr Tech
When creating a php script such as a CMS or a CRM, do you recommend using a php framework? Or should you just develop your own framework for that one script?
I've been looking around at php frameworks and the popular ones seem to be CakePHP, Zend and CodeIgniter...
What are your thoughts? If you agree php frameworks are the way to go, which one do you use or recommend?
Posted: Wed Nov 28, 2007 4:11 am
by dbevfat
Hi,
I'd definitely use a framework, unless I knew the application would be very specific, in which case I'd write my own. But for a CMS or CRM, this is probably not the case.
As for which framework to choose, it doesn't really matter. All of those you listed are fine, I'd just add Symfony to your list and take a brief look at all of them. Pay attention to the things you'll be doing the most and choose the one you like. Oh, and Zend is the least framework-ish, it's more like a library but in the end it doesn't matter.
regards
Posted: Wed Nov 28, 2007 6:40 am
by Maugrim_The_Reaper
I use Zend and Symfony. Both are good in their own ways. I think it's always a good idea to use a framework of some description for any mid sized projects unless you can make a very good argument not to - otherwise you spend most of the time reinventing wheels instead of getting features added

. Of course, don't be afraid to decide which parts of any framework you dislike - for example, I never use Zend's DB component since I believe it's far too complex and diverging for its own good - so I substitute in something else entirely.
An important point is to pick a framework, and stick with it. You can try out others to see if they feel better - but the more you use one framework, the more efficiently you can get it to do your bidding, and the less time you spend learning all it's individual quirks and practices. Also be aware that learning any framework for the first time does take some time - factor the learning into any schedule you have!
Posted: Wed Nov 28, 2007 7:39 am
by kyberfabrikken
dbevfat wrote:As for which framework to choose, it doesn't really matter.
I'd say it matters a lot. Problem is, that it's hard to give advice on. Most of the available frameworks are excellent, but they are so in different ways. What fits you depends on the application, you're building and on who you are.
dbevfat wrote:Oh, and Zend is the least framework-ish, it's more like a library but in the end it doesn't matter.
As I see it, frameworks can roughly be described as partially a canned architecture and partially a library to support this architecture. The scope of the architectural part varies between solutions; Some focus on specific parts, while others try to encompass the entire application, perhaps even influence the development process as a whole.
In a way, you can say that all libraries has an element of architecture in them, since their interface influences the rest of the system. By that measure, the choice of calling something a framework or a library is subjective. What identifies the popular solutions, such as those you mentioned, is that they have a very large scope. Symfony, for example, spans almost all aspects of an application. This gives some benefits, but also comes at a price. You generally can't easily change architecture (That's what makes it architectural in the first place), so the larger the scope, the more you're locked in.
Re: Should I use a framework?
Posted: Wed Nov 28, 2007 7:45 am
by phpBuddy
Mr Tech wrote:I've been looking around at php frameworks
and the popular ones seem to be CakePHP, Zend and CodeIgniter...
What are your thoughts?
If you agree php frameworks are the way to go,
which one do you use or recommend?
I have tried installling several, including CodeIgniter.
Right now my favorite framework is
Solar PHP Framework.
It is young, but already the alpha release is very nice.
Have a look at it!
Some Features:
Locale, User, Auth, Access, Role, Form,
SQL_Adapter, Json, Http, Uri, Mail, Smtp
Here is a review article with code example:
http://blog.phpdeveloper.org/?p=62
Starting Simply with Solar
Posted in PHP, Solar, Web by enygma on the July 12th, 2007
In an effort to get to know as much of the technology out there,
I wanted to branch out in my framework knowledge and try something I hadn't looked much into yet
- the Solar framework (PHP5).
I've worked with both the Zend Framework and CakePHP on previous sites,
so I wanted to see how they compared.
Solar Framework Wiki - with tutorial and examples:
http://solarphp.org/
Official Links:
http://solarphp.com/
http://paul-m-jones.com/blog/

Posted: Wed Nov 28, 2007 1:04 pm
by alex.barylski
Always use a framework...
Whether or not you should roll your own depends on:
1) How much work you feel like doing - crafting your own framework takes time.
2) Your experience level. Coding a framework conceptually is quite different from developing an application.
Posted: Wed Nov 28, 2007 1:35 pm
by dbevfat
kyberfabrikken wrote:dbevfat wrote:As for which framework to choose, it doesn't really matter.
I'd say it matters a lot. Problem is, that it's hard to give advice on. Most of the available frameworks are excellent, but they are so in different ways. What fits you depends on the application, you're building and on who you are.
Well, I've made a few assumptions; the application is CRM/CMS and he's a person with no experience with frameworks. All of the listed ones are good enough and from that perspective, it
doesn't matter, which one he chooses.
kyberfabrikken wrote:In a way, you can say that all libraries has an element of architecture in them, since their interface influences the rest of the system. By that measure, the choice of calling something a framework or a library is subjective.
I disagree here; there is a huge and clear difference between a framework and a library, and libraries rarely have so strong architectural elements as to significantly influent the rest of the system. Also, determining what is a framework and what a library is not subjective; i.e. we're all sure that Symfony is a framework and SwiftMailer is a library. It's the ones in the grey area that we're not sure about. ZF maybe falls into that category (although probably more on the framework-side), since it doesn't enforce an application structure too strongly, and at the same time some of its modules are even usable in other frameworks as libraries.
kyberfabrikken wrote:What identifies the popular solutions, such as those you mentioned, is that they have a very large scope. Symfony, for example, spans almost all aspects of an application. This gives some benefits, but also comes at a price. You generally can't easily change architecture (That's what makes it architectural in the first place), so the larger the scope, the more you're locked in.
I agree. You really fly until you hit the ceiling, but then you're almost forced to go on your own, unless you're willing to take serious compromises or even extend the framework on your own.
regards

Re: Should I use a framework?
Posted: Wed Nov 28, 2007 4:07 pm
by Christopher
Mr Tech wrote:When creating a php script such as a CMS or a CRM, do you recommend using a php framework? Or should you just develop your own framework for that one script?
You have three obvious choices on what foundation codebase you build you application on top of:
1. Create new code
2. Use code that you have developed previously
3. Use code that someone else has developed
There are advantages and disadvantages. Depending on the project creating a greenfield codebase (#1) might make sense. However time is money, so the time you spend coding things that either you have already coded or can get elsewhere is costing someone money -- either you or your employer. Code you have developed has the advantage that you are familiar with it, though often the disadvantage that you don't realize the code sucks. Using someone else's code means you have to learn it and can customize it less, but it is probably better designed.
Mr Tech wrote:I've been looking around at php frameworks and the popular ones seem to be CakePHP, Zend and CodeIgniter...
What are your thoughts? If you agree php frameworks are the way to go, which one do you use or recommend?
Those are three different styles of frameworks ... I can only recommend that you download them and give them a try. Most people's experience is that they can't stand most of them and fine one or two that are close, of which only one has the needed feature. So you are doomed to some framework out there.
