Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7060975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:25:03+00:00 2026-05-28T04:25:03+00:00

I think that I am using too much conditionals and calculations in the TT

  • 0

I think that I am using too much conditionals and calculations in the TT templates.

I am displaying a result set of items from DBIc. For each item I need to calculate things using the retrieved values, and the template doesn’t seems to be the right place.

But in Catalyst it is a thick object that comes from DBIc.

So how can I move logic to the model? Must I run a whole loop for all items and change the object somehow?

Regards:
Migue,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:25:04+00:00Added an answer on May 28, 2026 at 4:25 am

    First, you’re on the right track by wanting to properly separate concerns. You’ll thank yourself if you’re the maintainer 6-12 months down the road.

    IMHO, your Catalyst controllers should be as thin as possible with the business logic in the various models. This makes it easier to test because you don’t have the overhead of Catalyst to deal with. I’ve been thinking about model separation quite a bit myself. There are two schools of thought I’ve come across:

    1) Make your DBIx::Class Result classes have the business logic. This approach is convenient and simple.

    2) Make a standalone Model which is instantiated by the Controller, and which has a DBIx::Class schema object. The model would use the DBIC schema to query the database, and then use the resulting data in its own business logic methods. This approach might be better if you have a lot of business logic since you separate DB access from business logic.

    Personally, I’ve historically used approach #1 but I’m leaning towards #2 for larger apps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't think that using .ini or .xml file is a good idea with
I think that this problem can be sorted using reflection (a technology which I'm
Now I am using Adobe Cirrus in my Flex app, but I think that
I want to perform disk I/O operations for a program that takes too much
I think I may be applying too much of my normal context (web app
I am new to using numpy and one thing that I really don't understand
just think that when I opened my file then when I want to write
I think that Visual Studio's biggest let down is the Javascript editor. I have
I think that the zipper is a beautiful idea; it elegantly provides a way
I think that some newer languages like JS can do this natively, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.