Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java web application Front end [closed]

I have a large application that is using Java on the backend and struts, Jsp and JSTL tag library on the front end. Database is DB2 and we rely heavily on Stored procedures.

We are planning to upgrade the application to a new architecture/framework.

The main framework we are considering is Spring, although our leads are trying to push us to adopt Java EE instead claiming it's better framework.

Any recommendations as to which way to go with Spring or Java EE? Any main reasons to prefer one over the other (advantage/disadvantage)?

For each one of those, what is the best alternative for JSP taglib ? We use to have to write all the html tags manually to display dynamic data with JSTL. I am reading about new frameworks like Angular and JSF components. I am not sure also what is widely used these days. I read that more and more programmers are passing the data from REST services as JSON to front-end. What do they use to render the data, is it JSF, Angular?

I do .NET programming, and in ASP.NET we have data binding and components like ListView, etc. Are JSF and Angular the same?

Any web-site with good examples, documentation (especially architecture) that you recommend?

like image 333
daoud175 Avatar asked Feb 24 '15 13:02

daoud175


2 Answers

Java EE and Spring are both very good and very comprehensive frameworks for writing backends. Both of them should be able to do exactly what you want. I would recommend using whichever your team is familiar with but I'm going to stay out of the details since you will be able to make a high quality application with either one very easily.

As far as the front-end goes, I have personally gotten the best results out of creating a RESTful API and using that to send data to a front-end Javascript framework. Angular is really good for this. One reason for this is that the Javascript frameworks tend to provide a lot of power when it comes to writing good web front-ends. JSF is a server-side, component based MVC framework, and that generally gives you less control over the the HTML + JavaScript that's being created and makes it a lot more difficult to write tests for.

I've also found that at large shops, you can't always trust people to do things the right away. Separation of concerns is important, and I like using a JavaScript framework like Angular for the front-end because it goes a long way to keep front-end code out of the back-end. The JSF applications we have at my workplace are rather terrible, because the developers abused things like sessions. The JSF code also lived in the same deployment as the backend. Instead of using web services and taking a service oriented approach and keeping everything loosely coupled, we wound up with giant 'blobs' of code that 'do everything'.

like image 143
Dogs Avatar answered Sep 24 '22 23:09

Dogs


A lot depends upon your team they are comfortable with.Both Spring and Java EE can do everything for you, but personally I will suggest spring jdbc + spring mvc modules for backend. Spring injection functionality is very helpful for web application. Also spring jdbc module create environment and create sessionFactory for your jdbc calls.

Create rest-api in your controller that will make your life very easy. Spring also provides a lot of templates which act as base classes to make using the Java EE standard technologies a breeze to work with. For example, the JdbcTemplate works well with JDBC, the JpaTemplate does good things with JPA, JmsTemplate makes JMS pretty straightforward.

  • https://spring.io/docs
  • http://www.mkyong.com/spring/maven-spring-jdbc-example/

Also for maintence point of view spring is best because it is popular and mostly developers are familier with spring.

For front end angular is superb because AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test.

Data-binding is probably the coolest and most useful feature in AngularJS. It will save you from writing a considerable amount of boilerplate code.

like image 20
Joginder Malik Avatar answered Sep 22 '22 23:09

Joginder Malik