Introduction to Qcubed
For several years, Qcubed has been my php framework of choice. I'll be writing about Qcubed frequently so I wanted to first give an overview of its features. Read on for my overview.
Briefly, it is composed of 3 parts:
ORM layer
This encapsulates your database tables as objects with conveniant functions for creating, saving and querying properties. This represents the 'model' in MVC design. A sophisticated querying mechanism is included, called QQuery, but custom handwritten SQL can be used as well.
Qforms
Qforms is a stateful, ajax-capable library for creating all the controls needed for user interaction. Qform components are object oriented and have an event-driven architecture. This is the 'control' part of the MVC paradigm. They also can include html templates, so the html renderings of the Qform controls in their HTML templates represent the 'View' of MVC.
The Code Generator
Qcubed can automatically generate all of the ORM code and simple form drafts representing the basic CRUD functions of a typical database based Web application. You can easily change the underlying database structure and regenerate the code without affecting any of the code sitting on top of it it due to the inheritance structure of Qcubed.
Note that although this sounds like Ruby on Rails or any other Active Record based framework, there is a difference. Most Active Record implementations use Run-time Reflection to determine how to implement CRUD functions or database relationships. Qcodo does all of this at the beginning in a code generation step, so theoretically the performance can be better.
The best part of Qcubed is the flexibility. I often only use the orm layer, which means that I can begin designing my applicaiton by creating my model in the Database. After quick codegen, and I have all the objects I need for my app. If I discover I need a new column, or need to normalize my schema, I can safely alter my Database and re-codegen, gaining all the new ORM functionality without breaking anything.
I'm not forced to use, or even learn, anything about Qforms if I don't want. This lets Qcubed fit in nicely with other php frameworks, javascript libraries, etc.
I will be writing more about Qcubed in the future, in particular how I use it in my projects and some extensions I have made for it.
Check out http://qcu.be for more information.





Post new comment