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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:10:20+00:00 2026-06-10T05:10:20+00:00

I have a service layer, exposing methods to my MVC ‘layer’. Lets say I

  • 0

I have a service layer, exposing methods to my MVC ‘layer’. Lets say I have a method that:

Public List<StateObjects> GetStates()

Is it good or poor design to then call that method, from the constructor of my Model object, to maybe build a SelectList of States, for my View? Should the Model have reference to my Service layer, and ALSO, allow my Controllers to have reference to my Service layer? Or should the population of the model’s variables be done in the controllers, so have all logic in the controller?

  • 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-10T05:10:21+00:00Added an answer on June 10, 2026 at 5:10 am

    As you’ve pointed out there are 2 real options:

    • Populate the Model in the controller, using data returned from your business/domain layer
    • Populate the Model data inside the model via its constructor, properties or a method.

    There is also a third option, which is to have the MC part of MVC in your domain layer. This makes it easier for model population but does blur the line a little a bit (if you are a purist) with what the business layer does. Practically, it doesn’t really matter until you’re building a giant enterprise model.

    My particular preference is to have a static

    public static MyModel FromDomainObject(DomainObject object)

    method on the models. You can then use this in your controller and pass in the domain object in the action to get a Model back, which you pass to your view.

    The important part is to make sure the properties in the Model don’t populate on demand, and the methods aren’t accessible to the view. In reality you or the team will be calling these methods/properties and will know the implications, but it helps to keep the separation of concerns and decrease the coupling.

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

Sidebar

Related Questions

I have a service layer that exposes a method, which returns me a List,
In my service facade layer, I have a service class with a method/operation that
I have a service layer method that I want to expose that should return
I have this sort of format asp.net MVC View -> Service Layer -> Repository.
I currently have service classes that look something like this public class UserService :
I have a service layer that I would like to convert into a webservice.
If I have a service (service-layer object not web service) called WidgetProcessor and that
I have no DAO service layer in a spring MVC project. IN my controller,
I have a WCF service layer in my application that passes DTOs to UI.
I have a service-layer Interface that extends from a base Interface; I would like

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.