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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:44:41+00:00 2026-05-24T13:44:41+00:00

Spring provides formatters (and converters) with the use of annotations. This means that a

  • 0

Spring provides formatters (and converters) with the use of annotations. This means that a request parameter can be annotated on a controller to format user input and also a property of a data model class can be annotated to format data for a view.

The latter seems to me as a clear violation of MVC’s main purpose, that is the separation between model and view. Annotating a data model class with formatting specifics binds the model to the view. If the model hast to be used for some other view or for anything else, it can’t, since its fields are formatted for a specific view.

If I am wrong let me know. If not, is there a way to format fields from and to view format without violating MVC?

  • 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-24T13:44:42+00:00Added an answer on May 24, 2026 at 1:44 pm

    Using annotations is a good declarative way to specify formatting – I would not give it up. An alternative would be a procedural way of defining conversions.

    As I see it, the problem is that pure model objects and form-backing objects get mixed together. If you want to “purify” your architecture, introduce form-backing objects that will be between user’s input and your model. If you think that it is too complex for the scale of your project, then you don’t need it. In this case, just be aware that the model object has a double meaning.

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

Sidebar

Related Questions

The Spring framework provides two means of programmatic transaction management: Using the TransactionTemplate .
Spring Framework provides many technologies for applications to communicate with each other over HTTP.
I wish to use Spring MVC to provide a REST web service. However, running
Is there a C++ Standard Template Library class that provides efficient string concatenation functionality,
I have a source object that looks like this: private class SourceObject { public
I have a web application that's based on Spring and the application contexts, applicationContext.xml
as it is stated at http://static.springsource.org/spring/docs/2.0.8/reference/orm.html The Spring Framework provides integration with Hibernate, JDO,
I can't find information on how to use the CultureInfo classes (or whatever is
Spring provides the FactoryBean interface to allow non-trivial initialisation of beans. The framework provides
Spring Provides e Application Listeners to handle Application Events. I want to get rid

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.