30 May
Glue vs. Full Stack
[Note: looks like the move to the new server will take some time as I configure things *just so* so blogging can continue]
So I’m sitting around thinking about how I’m going to build out the new rallyhat.com, turning it into a “plan a baseball road trip site” and figuring out what tech to use. To be honest, I’ve gotten kind of bored with Ruby on Rails for a few reasons. One is that I understand the tech behind Rails, and don’t agree with a lot of the magic methods that Ruby seems to be encouraging. I like to sort of understand what’s going on rather than being told “just do it this way”. I don’t understand Ruby enough to wade into the source for Rails and figure things out. Secondly is that I haven’t touched any Rails code in months, so any momentum I had has leached out.
So, I like to learn new languages because, well, it makes me a better programmer. I’ve spent my time this year learning my way around Javascript so I can get a firm grip on just how all this Ajax stuff is supposed to work. Now I’m glancing over at Python and trying to decide if I want to invest in learning Python so I can try out Django, a web application framework that gets lots of nice things said about it. Not as flavour-of-web-pi that Rails has become, but a solid, well-documented web application framework.
So naturally I do some research and found an interesting post about Python web development frameworks that talks about Django vs. Pylons vs. Turbogears. Very interesting reading and it convinced me that Django is the way I should go if I’m going to become a snake handler on this project. But I followed some other links and got to a page (can’t find it now of course but I remember it) where there was a discussion of glue vs. full stack frameworks.
A glue framework provides you with a bunch of components that you can use together, but don’t necessarily have to. Zend Framework is a PHP glue framework, as it comes with all these cool components that you can pick and choose depending on what you need done. You’re not forced to use them, and this appeals to certain programmers who have fallen in love with their own quirky set of libraries and methodologies. This used to be me. To shift this over to Python, since I know no Python at this point i would be pointless to go with a glue framework.
A full stack framework gives you everything you need to create your web app, and pretty much forces you to use it. CakePHP is a full-stack framework. It has a bunch of conventions, and you must follow them or die. Okay, maybe you won’t die but your application will never work properly if you don’t understand the conventions. Django is a full-stack framework. So, given my knowledge level of Python I think that would be my safe choice.
However, I have the Imp of the Perverse mumbling into my ear that I should just build the damn site, screw Python because we’re tying to get something done here. So I’m thinking that I need to put my money where my mouth is, and build in CakePHP. After all, I have that cool interactive console to test stuff with.
So, give me some feedback: which do you prefer when building an application? Full stack or glue?

Posted by Kevin on 30.05.07 at 1:26 pm
There is also secret option #3 use WSGI and various pieces of middle-ware to make your own python based CMS framework. This would give you the best opportunity to learn Python, but will be a much higher investment in time and other resources.
Kevin
http://technogeek.org/
Posted by Nate on 30.05.07 at 1:26 pm
Hmm… I’m going with… glue! Wait, no, full stack! Yeah… full stack…. definitely…
Er, um, can I do a glue… stack…? Full glue!?
Posted by Garret on 30.05.07 at 1:26 pm
It think that as long as the stack follows MVC, it shouldn’t be too hard to figure everything out. I haven’t looked at Python or Django but I’m tempted to learn it as well, especially since Google uses Python for a lot of stuff. I’m in the same boat as you though - learn a new language or get it done!?!?
I see it as the ‘glue’ stuff being the ‘old way’, while the ’stack’ stuff is the ‘new’ way (and the best in my opinion, I did the ‘old way’ for awhile), at least when it comes to web development (I haven’t done much desktop dev so I wouldn’t know). Using a glue framework that is not MVC-based is like going to phpclasses and getting all of the classes you need, and then throwing it all in the pot with a few classes/interfaces that weld them together, which can be ugly if you don’t do inordinate amounts of planning. There really is a reason why MVC-based stack frameworks became so popular after ruby on rails came out. They make you code better, and they make you think better in terms of structure.
Posted by Tarique Sani on 30.05.07 at 1:26 pm
I personally like to experiment with glue but insist that my programmers build using a full stack. This is not due to the technical reasons but due the management necessity of allowing easy transfer of projects between teams.
IOW - I prefer opinionated software to opinionated programmers when it comes to commercial stuff
Posted by Nick Halstead on 30.05.07 at 1:26 pm
If you can use PHP 5 the ONLY option is to use Zend framework. None of the others make any use of proper OO abilities within PHP because they still using PHP 4.
As you have already stated the Zend framework is very much a ‘take what you want’ framework. But it is also, ‘extend what you want’ because the developers have made it possible to extend in every direction, you have simple helpers that allow you to add common functionality, plugins that add functionality to current classes, and also because its PHP 55 you can just extend what they have already built. In a recent article http://blog.assembleron.com/2007/05/30/zend-framework-rc1-and-zend-acl-usage/ I give a very quick example of extending the ACL (Access control)
I have nothing against any of the other frameworks (cake,symphony,etc) but right now the framework stands out as a beacon of ‘this is the way forward’
IMHO
Posted by Nigel James on 30.05.07 at 1:26 pm
I think it depends on the project and it depends on how much you want to get stuck with a stack. For some projects a full stack might be the bee knees but on other projects a bit of glue here and there is the way to go.
Its nice that PHP has a bit of both so there is an option how far down the framework rabbithole you want to go.
Posted by Chris Hartjes on 30.05.07 at 1:26 pm
@Nick: My boss says the same thing…but i need to be convinced of why. What is so special about PHP 5 that Zend Framework is the only PHP 5-based framework worth using? What features exist in PHP 5 that make it better for doing MVC?
Posted by Nate on 30.05.07 at 1:26 pm
Nick: if you actually realized what the differences (or lack thereof) are between PHP4 and 5 either under the hood or in terms of rubber-meets-road implementation, you’d know how big a joke what you’re saying is.
Posted by Pablo Godel on 30.05.07 at 1:26 pm
Anyone tried to do some serious OO programming with PHP 4? I almost died in the intent. I don’t understand why so many people wants to stay with PHP4. We had to migrate a series of apps to PHP 5 and it wasn’t that bad.
Posted by Dan on 30.05.07 at 1:26 pm
Until Zend Framework becomes full release, I can’t use it for anything ‘production’, so Code Igniter is what I’m using right now.
Give it a try.
Posted by Chris Hartjes on 30.05.07 at 1:26 pm
@Dan I’m a CakePHP guy myself…I’d love to see a comparison between Code Igniter and CakePHP. Both seem to be small, rapid web application frameworks. Why would you pick one over the other?
Posted by Stuart on 30.05.07 at 1:26 pm
In a nutshell… CakePHP is more stack, Code Igniter is more glue.
Posted by PHP User-Group Philippines » Blog Archive » On Frameworks: The Glue VS The Stack on 30.05.07 at 1:26 pm
[...] Well that’s it for my first post here. m/(^o^) You can read the whole article here. [...]
Posted by Garret on 30.05.07 at 1:26 pm
@Pablo, take a look at the source code of CakePHP and tell me that’s not some serious OO. I’m in agreement with Nate here.
I’ve looked at Code Igniter, and don’t get me wrong, it’s done some great work for EllisLab, but Stuart’s right when he says it’s more glue than stack. I read a report awhile back that showed it was a bit speedier than Cake as well. In response to that I say “Hardware is Cheap”.
Posted by tomek on 30.05.07 at 1:26 pm
Depends on a project, but usually glue is a winner thanks to the flexibility it gives - you not always need all the magic of ORM, filter chains or even friendly urls, especially at the cost of performance. Plus you can mix different packages easy - like for example use Zend_Db and ezTemplate in one app, without reading a tutorial on how to do make it possible in symphony or CakePHP
Posted by Pablo Godel on 30.05.07 at 1:26 pm
@Garret, I haven’t looked closely at CakePHP, so I can’t talk about it. My only question is, how do you guys deal with object references. It was a nightmare for my with PHP 4.
Posted by Carlo on 30.05.07 at 1:26 pm
Chris, I use this simple rhyme… Stacks are for Hacks, The Glue is for the Guru!
Posted by Nate on 30.05.07 at 1:26 pm
“Stacks are for Hacks, The Glue is for the Guru!”
Ah, the typical short-sighted PHP hack mentality. So sad.
Posted by Nate on 30.05.07 at 1:26 pm
Carlo: just for the sake of clarfication: it’s all been done before, your problems are not unique, you are not smarter than the collective wisdom of the industry, of the few new ideas that exist, you don’t have any… you are not special, you are not a beautiful and unique snowflake. You are the all-singing, all-dancing crap of the earth.
Posted by Jiri on 30.05.07 at 1:26 pm
Also, “glue” rhymes with “noob”. Coincidence? Might be!
Posted by Carlo on 30.05.07 at 1:26 pm
@Nate, i am sorry to have hurt your feelings, i have a rhyme for you that might make you feel better… The Stacks got your Back and the Glue is poo poo!
Posted by Nate on 30.05.07 at 1:26 pm
Hahaha, clearly you don’t know me.
Posted by Tomek on 30.05.07 at 1:26 pm
One more thing on the PHP5 vs. PHP4 issue. I don’t know the ‘under-the-hood’ specifics but from my (programmer) point of view there are a lot of differences that makes PHP5 far better than 4: exceptions, visibility control, static members, class constants, magic methods, Reflection, interfaces and so on. The first three things from that list are enough to make me not wanting to go back to PHP4. And that’s only on OOP level - PHP5 has a lot of other goodies like PDO, STL, ext/filter and so on.
As for the PHP5 frameworks - Zend’s one is not the only option.
There is Solar (http://solarphp.com/) - but I don’t know when it’s gonna achieve a stable state.
Then there are ezCompontents (http://ez.no/ezcomponents) - they really push PHP5′ OOP features to the max there. But it’s not the full stack framework (yet??) - like the name says: components.
And finally there is PRADO (http://www.pradosoft.com/) which is ‘different’
Posted by Michal Tatarynowicz on 30.05.07 at 1:26 pm
Why not just make two separate framework layers — a base library with things like sending e-mails, encryption, database abstraction, and build application templates on that?
An application template would be a set of configurable controllers, models and views that support a page-level functionality, such as an e-mailed contact form, grid data viewer, CRUD, etc.
Posted by Ian on 30.05.07 at 1:26 pm
Prado is event driven. If you have used ASP.NET, it’s a lot like that. I’ve played with it (and was happy), but wasn’t a fan of performance of it.
I wouldn’t say “Full Stack” versus “Glue”. It’s more
Do I need something I can drop in and attempt to solve all the worlds problems (and quickly)? Do I also have an unlimited hardware budget? If so, then go full stack.
Do I need something that gives me a great head start, but I cand build to what *I* (or my customer) wants? Then go with something like Code Igniter. The framework does not consist of parts you “glue together”. It’s a framework that has the basic functionality you would expect from an MVC framework, but makes you do more. The tradeoff is lightnigng fast speeds. I’d love to see the “little” performance gains. When I tested CakePHP, Codeigniter, symphony, and my custom framework Code Igniter was the fastest (followed by mine which had way more stuff loaded than CI). CakePHP was 60% slower and Symphony was downright painfull.
I refuse to use the big stack frameworks because of this. Yeah, we all know “hardware is cheap”, but explain that to a client when they talk about scalling. It’s not fun saying “Well, we saved $2,000 on developing your application, but your going to lose that in hosting costs the first year. You see this is really system intensive and we needed to get an extra server or two. After year two, you’ve actually lost money from using this”.
Posted by Chris Hartjes on 30.05.07 at 1:26 pm
@Michal: Well, that is sort of what the full-stack approach is like.
@Ian: You make some really good points there. I think Glue vs. Full-stack is also about programming styles. Of course, any custom-built solution that uses something like CodeIgniter as what glues it all together is likely to be faster than a full-stack solution…but I’m willing to be that adding things going forward is easier with a full-stack than with the glue approach. My friends who do use CodeIgniter tell me that they end up fiddling with their code quite a bit because, well, they end up having to write a lot of things themselves whereas CakePHP might already offer that to them.
You also talk about having to “… explain that to a client when they talk about scaling”. I think your argument is not a valid one, and that if you’re able to save a client $2K on development costs, you won’t be giving that back in terms of extra hardware requirements. What’s more expensive, developers or hardware? The answer is, of course, developers. In almost every application I’ve ever built, the bottleneck is not the code, it’s the main data source (database or otherwise) CodeIgniter is not going to make your database operations faster.
It’s okay to not use “the big stack frameworks”, but don’t kid yourself as to what the real issues are when you have to worry about “scaling” your application. It ain’t the code.
Posted by Mike on 30.05.07 at 1:26 pm
I build everything using PHPonTrax
http://www.phpontrax.com
Posted by Chris on 30.05.07 at 1:26 pm
Most of you are talking along the lines of constructing large applications/sites. For that I think I might go with stack for most things, provided the web host I’m working with even supports PHP 5, which is not always the case.
Not all the projects I do, are on that scale however. If I need to do a few contact forms, with spam/email injection protection, I don’t need a full blown MVC install to do that, just a good email class and spam filter system.
The glue approach, is not a “noob” approach, as there is much more to PHP development, then full integrated sites or applications. I personally dispise the dependency hell that ensues when trying to get something small done with re-usable components, when using something like PEAR, which is not as well supported or configurable, accross all the servers and hosters I have to work on.
I shouldn’t have to go back to writing non-reusable proceedural code, just because the project is small.
Posted by Loud Baking » Blog Archive » Choosing a development framework on 30.05.07 at 1:26 pm
[...] by Dennis Pallett - CodeIgniter vs. CakePHP, by Jonathan Snook - New Year’s Benchmarks - Glue vs. Full Stack and More framework fun, by Chris Hartjes - Comparing Frameworks, by Tim [...]
Posted by Kevin Dangoor on 30.05.07 at 1:26 pm
This is an interesting discussion. I just wanted to mention something regarding Glue vs. Full Stack. Trying to lump things into categories is always a tricky thing.
TurboGears is both full stack and glue. It covers everything you need to build a webapp and puts you on a path in terms of how to use the pieces, but it is built up from separate Python projects. Django is full-stack and largely consists of homegrown code.
There are so many frameworks (in every language) these days that they come in all kinds of shapes and sizes. Pick the one that gets you the most leverage on the project you’re tackling.
Posted by Joep Moritz on 30.05.07 at 1:26 pm
Zend Framework MVC implementation is very well done. The total package may require a few more keystrokes than things like Ruby on Rails, but you can extend and plugin at every layer imaginable. Very powerful if you need to develop a site that does not fit the standard model.
I’m going to try to hook it up to Qooxdoo for a web application using a single page and the entire site built in javascript. The Zend Framework allows me to hook into the MVC code at just the right location to change the output from the usual HTML pages to JSON. The last two I did simply used a ton of HTML with hundreds of INPUT tags.
Does anyone else have experience developing applications that runs in a webbrowser?
Posted by M.Ozan Hazer on 30.05.07 at 1:26 pm
I don’t see so much difference in between ZF, cakephp, symfony, rails or other frameworks…
Develop some fancy tiny scripts for a “glue framework”, and prepare some tutorials and screencasts telling “do it this and that way” and here you have a full-stack framework?? Do you have to put some strict rules to call it full-stack? (or am I missing smt.?:))
Well I don’t agree with “picking and choosing cool components depending on what you need done” because that’s not the aim of a framework… That’s pear etc. you’re talking about, isn’t it?
The power of a framework is, in my opinion, it guides how to work and puts some standards on how to work, beyond providing some fancy libraries.
So that the application will be reliable, easy to develop and easily understandable by multiple developers. Even a developer lately joined the team can easily figure out what’s going on when the standards are well defined and known…
Either way (glue or full-stack), if you’re working on an advanced or moderate project you have to understand the structure of the framework well…
…and when you know how the framework works pretty well, you can still prefer your own solutions…
Posted by pRtkL xLr8r on 30.05.07 at 1:26 pm
I just started a job as PHP programmer, and the guys in the shop wanted me to learn ZF ASAP so we would all be on the same page. It took about a week to get down the concepts (as I had never even heard of MVC until then), but once the snowball started rolling, it gets big very fast…it’s very powerful and easy to use. It’s nice to step in and start doing a little here and there, and do more and more as your skill progresses. Now that 1.5 is stable, everything is working pretty much as it should. These guys did their research on frameworks, and the lead guy is pretty anal, so it must have impressed him enough to want to use in on a production server, even before it was even stable…
Posted by Gyorgy on 30.05.07 at 1:26 pm
In my personal opinion small teams should use a glue framework and large teams a full stack because the biggest problem with large teams is communication, so it’s nice to have at least consistent components and conventions to work with. I wrote on frameworks on my blog here’s the link to that post: http://blog.primalskill.com/?p=111
Posted by ????? ????? ???? - FTM ??????? » Blog Archive » ?? ??? ????? ????????? ????? ? ???????- Glue vs Full stack Frameworks on 30.05.07 at 1:26 pm
[...] Glue vs. Full Stack [...]