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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:14:11+00:00 2026-06-13T22:14:11+00:00

Until now I was mainly using Struts 2 , Spring , JQuery technology stack

  • 0

Until now I was mainly using Struts 2, Spring, JQuery technology stack for building web applications. The point is, that mentioned stack uses server side MVC pattern. The main role of web browsers was limited to a request/response cycle (+ client side validation). Data retrieval, business logic, wiring and validation were mainly responsibilities of the server side.

I have few questions regarding AngularJS framework that were inspired by following quotes I’ve read:


From the AngularJS tutorial:

For Angular apps, we encourage the use of the Model-View-Controller
(MVC) design pattern to decouple the code and to separate concerns.

From the Wikipedia Model–view–controller:

Model–View–Controller (MVC) is an architecture that separates the
representation of information from the user’s interaction with
it. The model consists of application data and business rules,
and the controller mediates input, converting it to commands for the
model or view


AngularJS uses client side MVC pattern. So I guess there is no other option then to include validation logic also to the client side in some way?

What would be the best way to write a robust AngularJS application? MVC on client side and some kind of MC (model, controller) on server side?

Does that mean, that MODEL and CONTROLLER are in one way duplicated (client/server)?

I know my question is somehow weird, but I think the reason is, that I am somehow acustomed to traditional server side MVC pattern. I am sure there is someone, that have already done same transition.

  • 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-13T22:14:12+00:00Added an answer on June 13, 2026 at 10:14 pm

    Not at all a weird question – I’ve been trying to sell Angular to a lot of java developers and they ask this. I asked it myself when I was learning (I’m still learning, btw)

    If you take a ‘conventional’ java webapp as you’ve described and Angular-ize it, you’ve got to first take your server and make it a RESTful API. Remove the JSPs, etc. This is actually the hard part, IMO, of writing an Angular app – getting the REST API right. The key for me to deciding what logic needed to go into the server was thinking of it as a pure api and forgetting for the moment that it will have a front end.

    That question really helped me – if someone tries to save a given resource and that resource doesn’t have valid data there’s no front end to tell them – they’re hitting the API directly so the API needs to reject it. So, the back end is responsible for the deep validation. This applies to your business logic as well. Assume someone is using just the API and it will become clear what your server needs to do.

    The server needs also to vend data in (probably) json format (I use Spring MVC + Jackson), so it’s responsible for exposing the model to Angular, and communication with the database.

    So what’s the MVC then on the Angular side?

    • Model: The data that comes from the REST API. If the API is vending JSON, then these objects will already be 1st class javascript objects.
    • View: HTML, and directives when you need to manipulate the DOM
    • Controller: (and custom services that you’ve factored out of your controllers..)
      • Queries the REST API and puts what’s necessary for the View on the $scope
      • Provides callbacks for directives to respond to events that might then require calls back to the server.
      • Validation: usually via a callback to a directive. Will likely overlap some of the validation you’ve already put in the server, but you don’t want your user to wait for the server to validate everything – the client should know something about the validation to give the user immediate feedback.
      • Business logic: Pretty much the same story as validation.

    But why the duplication of logic in the client and in the server? Mostly because you’re not writing one app, you’re writing two independent things:

    1. a REST API that needs to be robust and usable without a front end
    2. a GUI that needs to give immediate feedback to a user and not necessarily wait for a server.

    So, short answer – get the REST API right by forgetting that there will be a UI, and what goes into Angular will be much clearer.

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

Sidebar

Related Questions

I'm new to Oracle (I've been using MySQL mainly until now) so this might
Until now, I have not create any massive applications using ASP.Net. However, I am
Until now I've been only writing console applications but I need to write a
Until now I was logging the Error message and the stack trace of an
Until now I've been used to using DAOs to retrieve information from databases. Other
Until now, I was debugging my PHP scripts and testcases using vim and the
Up until now I used DateTime.Now for getting timestamps, but I noticed that if
Up until now I just put all my jQuery goodness inside the $(document).ready() function,
I'm learning scheme and until now have been using guile. I'm really just learning
Until now, I've used jQuery validation plugin with previously defined fields. Now I'm working

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.