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.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |