[Catalyst] Shoot out -- Catalyst / RoR / Other MVC apps --

Christopher H. Laco claco at chrislaco.com
Wed May 9 16:22:05 GMT 2007


In the case of the example above:
See svn.mangoframework.com/CPAN/Mango/trunk/

Mango::Provider::Users is really a subclass of Mango::Provider::DBIC
that uses a schema to do its bidding. The users provider exposes
Mango::User objects...which are quite literally...stupid. They know
nothing of their maker...only the column data they've been given.

So, to start from the bottom, in the case of Mango, I have:

1. Mango::Schema/Mango::Schema::Users
    The DBIC you know and love.

2. Mango::Provider::DBIC->isa Mango::Provider
    Generic provider that knows how to ask DBIC schemas to CRUD in
    a Mango way

3. Mango::Provider::Users->isa Mango::Provider::DBIC
    Specialized provider that knows how to CRUD users...
    Is using the DBIC provider by default, but could use
    other providers instead..like LDAP/OpenID

4. Mango::Catalyst::Model::Users->isa Mango::Catalyst::Model::Provider
    Thin wrapper that knows how to turn Mango providers into Catalyst
    Models...

5. MyApp::Model::Users -> isa Mango::Catalyst::Model::Users
    Thin wrapper to reuse generic users model in current Cat app

It seems like a lot...but most of it is very very thin....

=46rom the apps perspective... I can use a totally different Users model
to get user data (assuming it conforms to the same API)...

I can use a different Mango Provider to get user data (LDAP/OpenID, etc).=
=2E.

I can use a different schema, as long as the provider exposes the same
fields.. (Well, really, the Mango::User object API)....

=46rom the core perspective... I can use Mango::Provider::Users in any
code...console apps.. Tk Apps...cron jobs...etc

For some people, that's entirely too much magic...just use a Model and
be done with it... for apps where the core bits needs to be reusable in
non-web apps, or inside of other peoples apps...abastract...

-=3DChris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070509/f770b1ab/signature.pgp


More information about the Catalyst mailing list