miguelele has asked for the wisdom of the Perl Monks concerning the following question:
I need wisdom on structuring procedural code in Catalyst
My status:
- I am porting a REAL working Flex application while learning Catalyst and remembering Perl
- I would like to stick to the Catalyst easiest ways before being "creative"
The structure:
- I have a Controller for "People" with subs like list, detail, edit, notify, etc
- In Detail view I get data from two sources:
- After retrieving everything from the two sources, data is mixed and processed (like invoices, debts or connections), preferences are applied and the right information is displayed depending of the user permissions.
The problem:
- As I am adding functions, the Controller is getting bigger, and I have learned that controllers must be thin.
- The SOAP process itself also have a lot of code to retrieve and process incoming data, and I do not know how to isolate like the same way as the Result Set from MySql
My question:
- Where that code belongs to?
- An Included file seems to be very ugly, or not?
- Mostly it is procedural logic. But I imagine that a good idea should be create something like a "subcontroller" named Person, almost like a Class.
I am really lost. Need some guidance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I need wisdom on structuring procedural code in Catalyst
by moritz (Cardinal) on Oct 29, 2011 at 11:00 UTC | |
|
Re: I need wisdom on structuring procedural code in Catalyst
by Your Mother (Archbishop) on Oct 29, 2011 at 18:25 UTC | |
by miguelele (Beadle) on Oct 29, 2011 at 23:02 UTC | |
|
Re: I need wisdom on structuring procedural code in Catalyst
by Anonymous Monk on Oct 29, 2011 at 22:53 UTC |