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 7028887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:27:58+00:00 2026-05-28T00:27:58+00:00

I am pretty new to ColdFusion ORM and I have some questions that I

  • 0

I am pretty new to ColdFusion ORM and I have some questions that I was hoping to get help with.

I am working on a framework that utilizes a pretty standard and strict MVC architecture. This framework also has a “service layer” that sits in between the controller and the model. The service layer is handling all of the business logic and validation.

A standard CRUD process goes like this:

user submits a form through the view –> view submits to the controller –> controller sends to the service layer for processing –> the service layer can perform any sort of business logic and validation to the request –> the service layer then sends the data to the model –> the model runs a transaction with an EntityNew() and a EntitySave() –> the model then sends back a response with an ID back to the service layer –> the service layer applies some logic and builds a message for the user –> the service layer than sends the response message to the controller –> the controller then sends it to the view –> the view then displays it to the user.

This process works good and I am happy with the separation of roles. It keeps all of the logic away from the view, controller and model and isolates it in the service layer.

My question is when I need to communicate with the database at the service layer for things like checking if a username is unique for validation how should I do that? Right now I am just running a EntityLoad() right in the service layer. This seems to technically go around the model layer and interfaces directly with the database by way of ORM. Would this be considered breaking the MVC framework.

Another thing I am not sure about is if I need to populate a drop down in the view with data from the database I am running the EntityLoad() right in the view to get the data for the drop down. Again, this is technically going around the model to communicate with the database via ORM.

I guess I am just confused about the best practices of using ORM in a strict MVC framework. Should I have separate methods in my model files for every interaction with the database and then just have the view or service layer communicate with those methods in the model? The organization of everything seems to be lost when I try to think about it like that.

Just trying to wrap my mind around this.

Any help on this subject would be greatly appreciated.

Thanks in advance.

  • 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-28T00:27:59+00:00Added an answer on May 28, 2026 at 12:27 am

    In my opinion, using ORM directly from the service layer is fine. There is probably not a good reason to abstract further. Think of the ORM functions as a Gateway or DAO. You could put those functions into a Gateway or DAO if you really wanted to, some do.

    Using ORM directly from t he view, however, is wrong. Don’t do it. There are a couple better ways to handle it.

    • Have the data you need returned with the other data to build the page from the controller (which talks to the model).

    • Make a remote call from the view to the service layer (Ajaxy) to get the data.

    There are probably (possibly?) other ways to handle it. But the bottom line is that your view should not be talking to the model layer.

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

Sidebar

Related Questions

I'm pretty new to J2ME development scene. And for that matter, have just recently
Pretty new to threading and I have this QList that the threads share between
Am pretty new to SharePoint, am working on creating a custom permission that I
pretty new to vb and I want to get a tab control working. so
I'm still pretty new to asp.net web forms. I have a requirement to make
I'm pretty new to learning about java and android development; so please help me
Pretty new to jquery but i was hoping to be able to target a
Pretty new to the Magento e-commerce solution. Have it up and running for a
Pretty new to PowerShell and hoping someone can point me in the right direction.
Pretty new to Mono for Android (C#), and I'm seeming to have trouble during

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.