Distinguish Frameworks
Moderator: General Moderators
-
mudgil.gaurav
- Forum Newbie
- Posts: 17
- Joined: Wed Oct 08, 2008 4:39 am
Distinguish Frameworks
Hi All,
I want to have an discussion regarding the frameworks available in PHP. For my project i am planning to use Symfony but i have a spark of doubt , that every framework offer caching , library and plugin files. So how we can distinguish each framework in terms of development time , performance etc.
Any suggestion would be greatly appriciated.
Thanks
I want to have an discussion regarding the frameworks available in PHP. For my project i am planning to use Symfony but i have a spark of doubt , that every framework offer caching , library and plugin files. So how we can distinguish each framework in terms of development time , performance etc.
Any suggestion would be greatly appriciated.
Thanks
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Distinguish Frameworks
Frameworks are great once you are confident with them - i.e. almost an expert. But until then it is a difficult and painful process, as documentation is bad.
I starting learning cakephp a year ago for about 6months, I bought all the books and went through all the tutorials, but still it was hard. Decided to change to Zend, as many people recommended it. Zend has the same issues as cakephp in terms of learning. Documentation always assumes so much. Including the books too.
So in the long term it would be good to learn & use a framework, but initially it would be a very slow process with a steep learning curve.
I starting learning cakephp a year ago for about 6months, I bought all the books and went through all the tutorials, but still it was hard. Decided to change to Zend, as many people recommended it. Zend has the same issues as cakephp in terms of learning. Documentation always assumes so much. Including the books too.
So in the long term it would be good to learn & use a framework, but initially it would be a very slow process with a steep learning curve.
Re: Distinguish Frameworks
Not all frameworks offer plugins. Technically all I need to write to have a framework is a few lines of code that implements inversion of control... Within frameworks theres a vast taxonomy of breakdowns, are we talking frameworks with MVC components, full stack frameworks, data access frameworks, testing frameworks, dependency injection frameworks, silicone chip manufacturing frameworks ( sematech? ).
For web frameworks I generally look at separation of presentation from business logic as a must. Search engine friendly URLs are almost essential as well. 2 frameworks I hear handle this good is Zend and Rails. I'm sure symphony, code ignitor, cake PHP, etc.. all have very similar stuff.
For web frameworks I generally look at separation of presentation from business logic as a must. Search engine friendly URLs are almost essential as well. 2 frameworks I hear handle this good is Zend and Rails. I'm sure symphony, code ignitor, cake PHP, etc.. all have very similar stuff.
- volomike
- Forum Regular
- Posts: 633
- Joined: Wed Jan 16, 2008 9:04 am
- Location: Myrtle Beach, South Carolina, USA
Re: Distinguish Frameworks
A downside of frameworks is that developers become biased to only using that framework, or only a couple frameworks, and perhaps not the one you prefer.
Every developer I know uses CI (Code Igniter) and are crazy about it. A few in this forum use something called Skeleton. I wrote my own lightweight MVC framework, my own ORM class, and my own DB abstraction class. Perhaps I might start to use CI eventually so that I can assist on a project already started in CI, or work in a team.
I don't see a lot of fans of Zend Framework, Cake, or Symfony here. But when I do, they are definitely crazy about their framework choice.
Every developer I know uses CI (Code Igniter) and are crazy about it. A few in this forum use something called Skeleton. I wrote my own lightweight MVC framework, my own ORM class, and my own DB abstraction class. Perhaps I might start to use CI eventually so that I can assist on a project already started in CI, or work in a team.
I don't see a lot of fans of Zend Framework, Cake, or Symfony here. But when I do, they are definitely crazy about their framework choice.
Re: Distinguish Frameworks
Skeleton was written by the people here. That is why you see people mentioning it. I don't think anyone claims any single framework is perfect. I'm personally a fan of Zend. The thing is in reality most projects use only some components of a framework, and often components from more than one framework
- volomike
- Forum Regular
- Posts: 633
- Joined: Wed Jan 16, 2008 9:04 am
- Location: Myrtle Beach, South Carolina, USA
Re: Distinguish Frameworks
Recently I heard of people installing ZF just to get its library of goodies, not using its MVC, and then rolling their own MVC. Seems like a good idea. However, another route is to just download ZF, Skeleton, CI, Cake, and Symphony, and cherry pick (with cut and paste and alter) the best ways to do something out of that and pull into your own classes.josh wrote:The thing is in reality most projects use only some components of a framework, and often components from more than one framework
Re: Distinguish Frameworks
I on the other hand use Zend for its MVC, some of the web services they have are great, I use its forms library as well. For data access I started with Zend_Table, started using doctrine, then eventually rolled my own ORM written ontop of zend_select. Some of the stuff in there like ascii art is useless to me.
Yes I remember you showed me your code, it was very well written but also way too lightweight for a serious app in its current stage ( IMO )... I'd recommend building out a sample app in Zend just to learn what it does. I'd recommend playing around with the router, and URL view helper. From what I remember your framework handled viewscripts and view script variables very well but didn't have a lot of scaffolding in place to handle other things I'd expect from a MVC framework
Yes I remember you showed me your code, it was very well written but also way too lightweight for a serious app in its current stage ( IMO )... I'd recommend building out a sample app in Zend just to learn what it does. I'd recommend playing around with the router, and URL view helper. From what I remember your framework handled viewscripts and view script variables very well but didn't have a lot of scaffolding in place to handle other things I'd expect from a MVC framework
If the framework is written right you won't have to cut and paste anything.volomike wrote: (with cut and paste and alter)
- volomike
- Forum Regular
- Posts: 633
- Joined: Wed Jan 16, 2008 9:04 am
- Location: Myrtle Beach, South Carolina, USA
Re: Distinguish Frameworks
I'm making two versions of the framework. One is simplistic like you saw. The other is big-boned, including a PDO-based DB class, ORM class, filter class, login/registration/password reset class, etc.
Re: Distinguish Frameworks
I use symfony. I seriously considered code igniter, but was turned off by the quality of its code base.
- volomike
- Forum Regular
- Posts: 633
- Joined: Wed Jan 16, 2008 9:04 am
- Location: Myrtle Beach, South Carolina, USA
Re: Distinguish Frameworks
CI was not based on PHP5, but PHP4. [Kohana](http://kohanaphp.com/) was a PHP5 fork of it. To me, Kohana is still heavier than I'd like it to be.
Re: Distinguish Frameworks
Well I'm sure I'll catch flac from CI fans, but I'm sorry, 4 or 5, it's just bad code. Just to make a point I downloaded the most recent version:
http://codeigniter.com/download.php
Opened up a random file:
system/libraries/img_lib.php
Line 1:
System files should be above the webroot. That solves the security problem and avoids cluttering the code with security garbage.
Line 108:
This is just not right. These need to be registered with the class automatically, not manually added to an array.
Lines 115-116
Not right again, no special considerations, this should be implemented in a way that can be called on and used as required for any circumstance.
Skipping lots of stuff, down to lines 460 - 463
Using @ is not acceptable in production code. Sorry, just that alone causes me to flag CI as a NO GO.
Now it's not fair for me to say all this without taking a random file from the framework I prefer, so I will.
...
I just went through about 15 random files and couldn't find anything I would improve. Check it out yourself, download 1.2 from http://www.symfony-project.org/installation
I'm not trying to bash any framework over another, all I'm saying is that I'd really prefer that the code I write sit on top of code that is better than mine. If I'm writing better code than the framework my code is running with, that's just not right.
http://codeigniter.com/download.php
Opened up a random file:
system/libraries/img_lib.php
Line 1:
Code: Select all
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Line 108:
Code: Select all
$props = array('source_folder', 'dest_folder', 'source_image', 'full_src_path', 'full_dst_path', 'new_image', 'image_type', 'size_str', 'quality', 'orig_width', 'orig_height', 'rotation_angle', 'x_axis', 'y_axis', 'create_fnc', 'copy_fnc', 'wm_overlay_path', 'wm_use_truetype', 'dynamic_output', 'wm_font_size', 'wm_text', 'wm_vrt_alignment', 'wm_hor_alignment', 'wm_padding', 'wm_hor_offset', 'wm_vrt_offset', 'wm_font_color', 'wm_use_drop_shadow', 'wm_shadow_color', 'wm_shadow_distance', 'wm_opacity');
Lines 115-116
Code: Select all
// special consideration for master_dim
$this->master_dim = 'auto';
Skipping lots of stuff, down to lines 460 - 463
Code: Select all
if (@copy($this->full_src_path, $this->full_dst_path))
{
@chmod($this->full_dst_path, DIR_WRITE_MODE);
}
Now it's not fair for me to say all this without taking a random file from the framework I prefer, so I will.
...
I just went through about 15 random files and couldn't find anything I would improve. Check it out yourself, download 1.2 from http://www.symfony-project.org/installation
I'm not trying to bash any framework over another, all I'm saying is that I'd really prefer that the code I write sit on top of code that is better than mine. If I'm writing better code than the framework my code is running with, that's just not right.
Re: Distinguish Frameworks
And what do people think about EZcomponents? It does look like a solid framework, from looking at it's documentation and a brief look at the source (although better coders then me should judge that last one). I don't hear too much about it. But maybe that's just because a few other frameworks like Zend, Cake and CI get more attention
Re: Distinguish Frameworks
In order to be a framework the code has to sit above yours. And I would probably not judge a framework based on the fact they included a webroot security check. The lack of setters & getters scares me thoughastions wrote:I'm not trying to bash any framework over another, all I'm saying is that I'd really prefer that the code I write sit on top of code that is better than mine. If I'm writing better code than the framework my code is running with, that's just not right.
- volomike
- Forum Regular
- Posts: 633
- Joined: Wed Jan 16, 2008 9:04 am
- Location: Myrtle Beach, South Carolina, USA
Re: Distinguish Frameworks
astions: Hahaha. Point well made. I'll have to keep this in mind.
Re: Distinguish Frameworks
46MB Zipmatthijs wrote:And what do people think about EZcomponents? It does look like a solid framework, from looking at it's documentation and a brief look at the source (although better coders then me should judge that last one). I don't hear too much about it. But maybe that's just because a few other frameworks like Zend, Cake and CI get more attention
Where did that come from? Never heard of it before. I downloaded it and the code doesn't look bad at all from what I see so far. I'll take a hard look at it, and I may take bits of the code and use them independently.