Matt S Trout
dbix-class at trout.me.uk
Sun Sep 23 17:24:04 GMT 2007
On Fri, Sep 21, 2007 at 08:57:35AM -0500, Peter Karman wrote:
> I've been thinking the last couple days about ways to expand
> Catalyst::Controller::Rose to play more nicely with other models besides
> C::M::RDBO. This is per mst's request to open up the RHTMLO goodness to
> non-RDBO users, and because I now find myself wanting the same thing. I have a
> model that isn't RDBO that I'd like to use in a project.
> So I'm proposing the following -- comments/criticism welcome.
> * CatalystX::CRUD::Model (CXCM)
> A base class for CRUD-like models. CXCM isa Catalyst::Model. Any CXCM subclass
> could be used with the C::C::Rose classes (or any other controller that decided
> to adhere to the CXCM API). C::M::RDBO would become a CXCM subclass.
> CXCM subclasses would need to implement at least the following methods:
> * new_object - returns CatalystX::CRUD::Object->new()
> * fetch - returns CatalystX::CRUD::Object->new()->read()
> * search - returns zero or more CXCO instances as an arrayref
> * interator - like search() but returns an iterator
> * count - like search() but returns an integer
Have you looked at the way the Handel storage stuff works? That already
supports both DBIC and RDBO so might be an interesting start.
Do you have any thoughts on how to paper over DBIC's ability to chain searches
vs. the lack of that feature in RDBO? I know most RDBO users don't feel
they're deprived not having it but DBIC users are generally fairly addicted :)
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
More information about the Catalyst