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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:15:00+00:00 2026-05-26T07:15:00+00:00

My architecture looks like this: View – Controller – Services Think of one of

  • 0

My architecture looks like this:

View - Controller - Services

Think of one of the views as a Person details page. The controller calls

(Person) service.getPerson(1234)

and returns the Person instance to the view to display. The way the service fetches the Person is by interacting through a RESTFul webservice.

The restful service responds back with following response:

<person>
  <id>1234</id>
  <name>John Doe</name>
  <person-detail-uri>/person/1234/detail</person-detail-uri>
</person>

The above response is mapped to a class called Person that looks something like this:

class Person{
    Long id;
    String name;
    String age;
    String address
}

A complete person object can be created by getting the person through

/person/1234

and then the details through

/person/1234/detail

Assume that the view needs to display person details.

Question:

Option A: Should the Controller call getPerson() and getPersonDetails() on the service to create a complete Person instance

or

Option B: Just getPerson() and let the view call person.getAge() that will somehow(probably through aspects) trigger a details fetch.

I lose some flexibility in Option A, however, it makes the model very dumb which I consider a good thing because then a bad code in view cannot pollute caches and hence may not cause performance concerns.

  • 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-26T07:15:01+00:00Added an answer on May 26, 2026 at 7:15 am

    There’s no “should”, it just depends. IMO it’s risky to allow the view layer to do lazy initialization because it’s easy to accidentally fire off lots of queries without meaning to.

    In addition, it makes the view layer fairly intelligent in that it now controls data initialization rather than isolating data fetch in the controller or model. I like dumb views, but that may be bias, rather than something based on a purely technical argument.

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

Sidebar

Related Questions

My application architecture looks like this. GWT in the UI layer -> Calls GWT
My app architecture / hierarchy looks like this: UIView UIView CALayer | CALayer |
I'm researching buffer overflows (on IA32 architecture) and I would like to clarify one
I namespace my models and a single controller like this: var MC = {};
The architecture for this scenario is as follows: I have a table of items
my query is about architecture and relation of classes, I would like to know
This is the architecture: SearchController retrieves data and fills a Telerik grid. Rows are
im trying to call a c++ template function in objective c that looks like
I am trying to program in MVC architecture. So, I have one HTML form
I have a simple MVVM architecture where I'm using a view model to bind

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.