Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Re: Plugin or controller? - How about a Role?

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


zzbbyy at gmail

Jun 3, 2009, 1:58 AM

Post #1 of 2 (775 views)
Permalink
Re: Plugin or controller? - How about a Role?

A question to the core devs - could that be a controller role? I
don't see anything preventing that - but I haven't yet gained any
experience in writing for Moosified Catalyst. I ask this question
because there is, quite common, opinion that roles can be cleaner in
many way than base controllers - so I wonder why this is not advised
here.

Cheers,
Zbigniew

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


bobtfish at bobtfish

Jun 3, 2009, 2:20 AM

Post #2 of 2 (716 views)
Permalink
Re: Plugin or controller? - How about a Role? [In reply to]

Zbigniew Lukasiak wrote:
> A question to the core devs - could that be a controller role? I
> don't see anything preventing that - but I haven't yet gained any
> experience in writing for Moosified Catalyst. I ask this question
> because there is, quite common, opinion that roles can be cleaner in
> many way than base controllers - so I wonder why this is not advised
> here.

Yes, it totally could.

Especially if your controller things are implemented as chained path
parts, this is an extremely powerful technique.

I was keeping quiet until I got chance to blog about a larger / more
complex example, which would better illustrate the question actually
posed, but given you brought it up anyway:

http://bobtfish.livejournal.com/264317.html
http://bobtfish.livejournal.com/264605.html

you want Cat 5.80003 and MooseX::MethodAttributes 0.12 or higher for it
to work right, but given you're running those it works well.

I'm currently porting some work code which has really complex structures
of repeated url hierarchies to use roles, rather than fairly involved
multiple inheritance, and the code is getting much easier for my brain
to understand as I go..

Cheers
t0m

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.