0

I want to build most of my functionality on the client. However I'm not quite sure which server-side web development framework can provide me with a nice REST endpoint to handle resources, business logic, etc. I come from a JAVA EE world, where JSF is mostly stateful and component based (both have their pros and cons, I'd just rather not keep a component tree, etc).. However...

I used to build templates in Facelets, how can I do this now if I don't use JSF/Facelets as my presentation layer? Or how do I create HTML tables iterating over collections, etc? I'm open to using any language/framework. I see a lot of discussion yet not really any valuable input. Perhaps I have yet to look in the right places.

There's a lot of people talking about JS + RESTful ws... Is this actually possible for a whole web site? I think that if I drop my component based web framework I'll have to implement so many things by myself, like conditionally rendered portions of the website, iterating over data to build grids, tables, handling multiple-page operations, view scoped data.

Maybe someone could also tell me: are you out of your mind? Go hybrid or don't do that. Any directions will help.

arg20
  • 101
  • 2

2 Answers2

1

There's no "right" answer to your question, but I'll tell you what I've chosen, and a bit about why.

Back-End

I come from a similar background, and I've chosen to use Spring Data REST as the service layer, because it provides a simple and flexible way to expose CRUD functionality for my data. Until I found this project I was writing the data access and REST service code myself, so it has saved me many months of work. It works well for me because there's not a lot of specific business logic that I'm worried about exposing in client-side JS.

If you prefer more control over your business logic, Spring Web MVC is really powerful but makes it easy to expose your services with a web service inteface.

Front-End

I started work on the web front-end using JSPs, and the page refreshes felt really sluggish compared to the more responsive client-side webapps that only retrieve the data that changes between pages, and only re-render sections of the page as necessary.

If you start looking into it, you'll find lots of different client-side JS frameworks that'll help reduce boilerplate and structure your code to be extendable and maintainable. My main reference for deciding on one was this comparison which considers around 10 of the most popular and describes how you might pick one based on your needs. Linked from there I found TodoMVC, which is a simple todo webapp implemented in all the same frameworks and more, which allows you to see them in action, and compare how they implement various common patterns in client-side JS development.

For myself, I chose Backbone.js because it met my needs and seemed to be the most widely-used, so I have a lot of resources when finding solutions to common problems. There are lots of secondary libs that can be used alongside Backbone.js as well, such as Marionette, Backbone.ModelBinder, and others.

Mike Partridge
  • 6,587
  • 1
  • 25
  • 39
0

There are lots of nice RESTful libraries in Java (as you mentioned you are from JEE background).

I believe all well-known languages available do have usable RESTful libraries. The choice of language should be more determined by something like: What language you want to develop your middle tier logic on? Is there any legacy code to make use? How it is integrating with other systems, etc. Simply "RESTful WS" is never a driving factor to choose the technology to use on server side (at least true for me).

Adrian Shum
  • 1,095
  • 7
  • 11