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

  • SEARCH
  • Home
  • 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 8594099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:07:37+00:00 2026-06-12T00:07:37+00:00

I am new to Grails. I have noticed that most tutorials show queries being

  • 0

I am new to Grails. I have noticed that most tutorials show queries being created and stored in the Controller. It seems like this could really bloat the controller over time, especially as queries grow in greater number and complexity.

In my research, I read that controllers should stay as lean as possible (having to do with requesting and submitting data to/from the model/view, and that heavy querying is discouraged.

How have you gone about creating, storing, and calling queries for your Grails application?

  • 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-06-12T00:07:38+00:00Added an answer on June 12, 2026 at 12:07 am

    There’s a good article about Grails best practices here. According to the post:

    Don’t allow the controller to take over another role. The role of a
    controller is to accept incoming requests, check permissions etc, ask
    a domain or a service for a result, give the result back to the
    requester in the desired format such as HTML, JSON, or XML. Keep the
    controller as thin as possible. Don’t perform business logic, queries,
    or updates within controllers.

    So if you have a more complex logic, I suggest you to build services:

    A service is the right candidate for complex business logic or coarse
    grained code. If required, the service API can easily be exposed as a
    RESTful/SOAP web service.

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

Sidebar

Related Questions

i have created new domain in grails and from a controller i've tried to
I'm new to Grails development. I have a domain class like this : class
I like the new Grails 2.0 where queries but need to do a projection.
I have created a new grails project and run it, but I can't see
I'm very new to Grails. I have a table like this : +----+---------+----------------+----------------+-------------+--------------------+--------------+--------+---------------------+ |
Hi I am new to grails and GSP I have a code like <g:each
Hi I'm very new to Grails. I have set of api's that I wish
I am new to Grails. I would like to create a reusable function that
I'm new to grails, but have previous experience using .net with c# and linq
I have a project which uses groovy 1.7.5 and grails 1.3.4. but my new

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.