|
An introduction to Qcodo
Frameworks for PHP are so omnipresent these days, chances are you’ve already tried out at least a few of them.
Frameworks for PHP are so omnipresent these days, chances are you’ve already tried out at least a few of them, including the Zend framework, Cake, Symfony, CodeIgniter or Prado, just to name a few that most likely will ring a bell. If you appreciate an overview of what’s out there, check out http://www.phpwact.org/php/mvc_frameworks or http://phpframeworks.com/index.php5. So why Qcodo?Each day I still manage to discover a new reason that confirms my choice from another perspective, but here are some of the Qcodo features that attracted me from the very start. - Qcodo doesn’t enforce but empowers
Most of the frameworks I’ve tried, always forced me to work within the framework environment, even for a static “Contact us” page. I hate this … if I don’t need the functionality, I don’t want it in the background neither. Qcodo is kind enough to stay away from the party when it isn’t invited, and that’s how it should be. But when Qcodo is on the guest list, the party rocks of course. - Qcodo goes for OOP
Before Qcodo, most of my PHP code was as procedural as possible. I never was able to grasp OOP fully, and didn’t understand why everybody was so into the concept. But Qcodo helped me to decrease the steepness of the learning curve, and gradually convinced me of the power & flexibility OOP brings. Today I can’t imagine myself writing procedural code anymore, since Qcodo & OOP took my skills to the next level. - Qcodo isn’t married to MVC, but they do date on occasion
Most PHP frameworks have embraced the MVC pattern, but mostly in such an extent, that a divorce isn’t an option anymore. Qcodo also loves MVC, but again, doesn’t force you to use it. If you don’t know much about the MVC pattern, you should get some reading done … basically it separates your - Models for data access (think of databases, XML, retrieving, saving, updating & deleting data)
- Views for presentation (think of XHTML, CSS, divs, tables, form layout)
- Controllers for business logic (PHP code that forms the glue between models & views)
… into loose entities, in order to improve re-usability of code and application structure. In the most basic setup, Qcodo separates controller and view (but if needed, they can be integrated in the same file), but MVC to the letter is also an option. - Qcodo supports AJAX
Qcodo comes out-of-the-box with great AJAX support. When I took the first AJAX tutorial on the examples site of Qcodo, I didn’t expect that I simply had to change a single line in my code to transform my “Hello World” example to AJAX. - Qcodo breaths code-generated ORM
Most frameworks these days provide some kind of database abstraction layer, combined with classes that allow you to easily query your database for all possible type of actions such as selects, updates, deletes, etc. The larger share of these connect to your DB at runtime, analyze the scheme, create the classes based on analysis and make them available for use in your code. Qcodo also provides such functionality, but hard-codes these classes as physical files, lowering the load on runtime. It takes relationships into account, and provides methods that cover these relationships. Let’s say you have a table called project, and a table called manager. The project table contains a foreign key (manager_id for example) that contains the unique id of the manager that owns a specific project. Qcodo will generate in this case the Project class, and a method for easily retrieving projects by manager, which might look like …
Project::LoadByManager($intManagerId) … and the function will return you an array of objects, with each object referencing a project that is owned by the specified manager … awesome, isn’t it? - Qcodo comes with QForm
Qcodo other great component is called QForm, and is actually a great way of defining forms, interweaving all kind of events with AJAX calls, rendering out datagrids with sorting and paging, data repeaters, drag & drop support, … simply too much to cover in this first post, but we’ll definitely get back to it at a later stage. - Form drafts ease the getting started phase
When you let Qcodo code generate data classes for your database, at the same time it also spits out form drafts. You could compare these to a scaffolding / CRUD feature, but then in a much more advanced way. You can extend the form drafts and use them as a platform for building your application. Every time you regenerate code (e.g. after adding a new column to a table), the form drafts will be regenerated as well, but your extensions will not. Same goes for your data classes as well … so you can extend the generated classes with custom classes, and add more functionalities. And when code-generating, your modifications will remain available. Why not Qcodo?Since I don’t want to disappoint anybody, I should be honest enough to discuss the potential disadvantages as well. Currently I really have no clue about where the project is heading. Don’t be fooled by the version numbers … perhaps the 1.0 release is still far away (we’re currently at a stable 0.3.32), but the framework has been found very stable during testing, and is definitely worth production. Check out sites such Chess.com that have been built using Qcodo to convince your self. However, the leading man behind the framework, Mike Ho, hasn’t been seen on the community for weeks now, and doesn’t respond at all on mails. Due to this, a share of the community has forked Qcodo towards Zcodo (QCubed), and is now trying to establish a community of devs to keep pushing the project. I’m not a great fan of forking, but due to Mike’s inactivity, I’m considering to also go my way with the current edition of the framework … but let’s wait and see. Meanwhile, here are some posts on this topic in the Qcodo forum so you can follow what’s going on Ok, I’m convinced … what’s next? - Great … head over to the Qcodo site,
- look at the screencasts,
- and at the examples site,
- download a copy of Qcodo
- and try to recreate the issue tracker by yourself.
Let us know below how your first Qcodo experience went, and any other comments or questions you may have … good luck!
Article information
Wroted: Thu, 03 Jul 2008 19:00:00 EEST Autors: Shahways Romani
Added by: AlexParamonov at Sat, 29 Nov 2008 19:01:30 EET Modified by: AlexParamonov at Sat, 29 Nov 2008 19:22:41 EET
Translation information
Added by: AlexParamonov at Sat, 29 Nov 2008 19:03:14 EET Modified by: AlexParamonov at Mon, 08 Dec 2008 13:34:34 EET
|
|