0

We have many siloed legacy multipage applications. For example, a personal information collection application may contain four or five HTML4 form based applications. The backend is based on Spring MVC and there is no javascript on the front. For example, a user may enter the name information on one screen and click next into their education background, etc. Each HTML page will contain a HTML form and data is posted back to the server on the next button.

Ultimately the portal is a collection of these siloed applications. Also, there maybe be only a few Spring based webapps that house multiple of these types of applications. For example, you may have a personal information set of Spring controllers in a Java package and html content in portal-web-app and then the help and feedback application is in the portal-web-app, etc.

I was looking to redesign using angularjs, reactjs, vuejs, or just jquery for front-end but don't see where it might aid in an application that supports multiple page apps or an application that still may require Spring MVC to render some of the content on the server side.

Why use a JavaScript framework? I mainly to want do more work on the client side. I see issues with using AngularJS because it seems that I would have to convert the entire portal site to use AngularJS and use one index.html with all of the app under that index.html. I was thinking about splitting each 4-5 page part of the app to use angularjs and then the index.html would only contain views for that 4-5 page part of the app. I see an issue where I would have to stream angular.js for each "sub" app. I guess this is OK if angularjs is cached. But there is also the issue where the 4-5 page part of the app would have to move to a separate java web application.

We could use just jQuery and connect to Spring MVC based REST services and receive the benefit of Ajax based application. This approach also allows us to support multi-page applications where some of the HTML content may be completely rendered by Spring MVC. There is more flexibility with this approach but jQuery seems too lightweight. For example, it seems easier and less buggy to build up a single view in AngularJS than with jQuery. It would be nice if I could get the directives from AngularJS without the requirement of having to build a Single Page app.

  • I see a few things floated here as potential questions...What are some architectural approaches? Why use a Javascript framework? How do I migrate a big application? Where shall we focus? – joshp Apr 1 '17 at 1:25
  • 3
    Don't get too hung up on the name Single-Page-App (SPA) - it's a lot less restrictive than it sounds. SPA does not mean that you need to convert the entire site into a single app, nor does it mean that the app itself only contains a single "page". SPAs generally contain many pages in the same app, but the page-switching happens all on the client. A website can host many SPAs. The caveat is that only one SPA should be active at any one time (multiple concurrent SPAs can produce some very unusual behaviour, but in reality it's rare that you would ever want to do this). – Ben Cottrell Apr 1 '17 at 1:34
  • So Ben you understand my problem, what if there are existing pages that are dynamic, say developed under Java server side code that you want to be able to see and get rendered. But how do you integrate that into SPA design? To josh's question, it is really about making use of the dev approach of a an ajax based app, REST services and use JavaScript MVC approaches, mainly it says time in development. – berlinbrown2 Apr 11 '17 at 22:13
  • Or simply, what are approaches are there to convert pages to Ajax, build the UIs without just jQuery – berlinbrown2 Apr 12 '17 at 18:10
2

I was looking to redesign

The first question, which comes to my mind is: why?

What is the concrete pain, you are suffering?

As long as you could not clearly answer this question, I do not see any reason to refactor - or in your situation even rebuild your frontend. If it works and generates money, why change it?

When you offer a perspective / a set of goals you could think of roads to go down to reach your goal.

  • If your pages are a mess because of jQuery-Spaghetti, you could simply rewrite it page by page without considering a JS framework.

  • You could consider something like StimulusJS (handbook) which came out of Basecamp, which is best suited for "traditional" webapplications, which would benefit from a bit enhancement.

  • Next, you could use vue or react without buying into the whole ecosystem. Say, you decide to try vue, you could just add it to one page and design only a small part of it to get a feeling, whether it suits your needs.

There is no need to go fully SPA unless there your business demands it.

Introduce a new "framework" with a small new functionality and look how it turns out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.