Hi all!
For a bigger Joomla component I decided to stop writing duplicate code for every view, model and controller and created classes extending JView, JModel, JController and JTable. As an outcome, my controllers and models are each 5 lines long!
All you have to do is write a special JTable file. Instead of doing classic
var $tablefield;
you give some more meta information about that field, like 'type', 'validation', etc. See the screenshot for an example.

What are the advantages?
Automatic generation of lists and edit forms taking full advantage of almost all grid functions (Ordering, Checkin/Checkout/Locking, Published, pagination). Also, filters are generated automaticly, if you specify which field of your entity is a parent join you get subsequent filters until the root entity is reached. When changing a filter of a parent, child filters are automaticly reset.
For the edit forms: Depending on your field's type (e.g. boolean, text, textarea, htmlarea, join, number) your form is populated with appropriate form elements. Also, you have server and client-side validation. And optional tooltips for each field to explain the purpose.
As little bonus, you can define your fields as 'translatable', in that case you get an input element for each language installed in Joomla. That means that components like Joom!Fish only have to change your site language and you can say goodbye to creating content elements and even better, you have your content and translations right next to each other.
A coming feature will be finely-grained ACL, that hopefully work hand in hand with Joomla 1.6's ACL. The idea is that each field of your entity can be set to readable, writable for certain user groups.
So why am I talking about this? I want to make those libraries (6 files alltogether) freely available and license them under the MIT license. But I want to know if people are actually interested in this kind of library. So let me hear what you think!
PS: You find the files attached. They have to be included in the component's entry file
UPDATE: I attached a
demo component (simple gallery component without frontend) to see the library in action.
libraries.zip
You need to be a member of All Together, As A Whole to add comments!
Join All Together, As A Whole