[eluser]webthink[/eluser]
Explanation with examples can be found <a href="http://webthink.ca/oobleck">Here</a>
During Webthink's last major project we noticed that a lot of time was spent writing controller code to deal with forms and and database interactivity. It seemed we were writing a lot of lines to accomplish the same basic actions with only minor variance from one controller to the next. Lists of form/db fields tended to be written on average about 4 times. a)to set up fields for validation b)to set up rules for validation c)to assign data from the db to an array to be used for defaulting forms d)to assign data from forms to an array to be used to write to the db. In addition to this a lot of procedural logic used to ferry data from the form to the db and vice-versa was repeated.
At it's core a controller is designed to handle control flow logic and business logic so we came up with an approach that seperates this from a lot of the repetative grunt work tasks that were rapidly filling up our controllers. The approach is two pronged: It relies on a pattern by which you organize your controller and a library to abstract some of the control code.
Keep in mind though that it really is just an approach. It's meant to be altered to fit your needs. You could theoretically use as little or as much of it as you please or simply give it a look over and implement something similar but better suited to your needs.
Some credit for inspiration at least has to be given to Michael Wales and his <a href="http://www.michaelwales.com/2007/10/erkana-codeigniter-authorization-library/">ErkanaAuth project.</a> We looked at it, liked it, and then decided not to use it. There in lies the beauty of it though. It's less of package and more of a suggested approach so when we looked over it we thought 'It's simple, it's elegant and there's really nothing to it. Let's write our own'. My hope is that Oobleck gets treated in much the same way. It's not a packaged solution it's more of a design philosphy from which people are free to take what they like. To the best of my ability I've designed it to be as non-invasive as possible but it is a rethink to the way we code controllers so requires a certain amount of buy in.
Additionally the motivation to abstract a lot of our controller code came after we did the same for our models. For that we adopted <a href="http://codeigniter.com/wiki/ActiveRecord_Class_Mod/">CoolIce's Active Record ORM Library</a> and in doing so completely stripped down our models.
The code is still in Beta so We'll be fixing it up as we go along. As we continue to develop and use Oobleck more for our own projects I hope to develop more flexibility into it so that it can handle more non standard scenarios. With one exception there won't be any feature development only development in expanding it's flexibility. That exception is of course a form generator. It seems a naturual fit and webthink->Andrew who does much of our front end implementation has a lot of experience with these sort of things. Whatever we do come up with will have to hang off of Oobleck but more than that it will have follow the same principles and be fully overridable and non-invasive.
Why Oobleck? Well mostly because "A patterned and abstracted approach to interfacing user input forms and database interaction within CodeIgniter controllers" doesn't lend itself very easily to a clever acronym. We needed a made up word. Fortunately <a href="http://en.wikipedia.org/wiki/Oobleck">Dr. Suess provided us with a great one</a>
Hope it can be of use to someone.
webthink->Julian