You get better responsiveness if you send down pre-rendered html for the first page load. This means you still need the conditionals, or suffer on responsiveness.
If you care about optimizing it, you can get your JS UI to render faster than the equivalent pre-rendered HTML would have.
If you want to serve screen readers, then yes, you need to make sure you're serving only reader-compatible HTML and JavaScript.
It doesn't rule out a pure client-side app at all, but you do have some extra work involved to output HTML from the server. Which is why NodeJS will ride on the coat-tails of this approach; less redundancy.
- JAX-RS (RESTful)
- JAX-WS (WebService)
- MVC (view-based web-app)
And in contrast to what people believe, you don't need to write tons of code and still get full re-usability from the Services/Repositories layer.
On the front-end, you have a choice of:
- GWT for thick-client via RPC (return serialized Java object) or AJAX (return JSON)
- JSP, JSF, any templating available
- Mobile, Desktop, anything
1) Spring Roo is not necessarily a more modern approach. It's more similar to Rails.
2) JAX-RS is more like Sinatra than Rails. Generating JSON api is already simple in JAX-RS.
3) Not everybody wants ActiveRecord
http://www.braintreepayments.com/devblog/untangle-domain-and...
https://github.com/braintree/curator#readme
4) JAX-RS comes with standard Java EE (moot point)
5) You can re-use your Servlet knowledge with JAX-RS to some extend (Filter, setting up web.xml, etc)
Not to take anything away from Spring Roo which is a wonderful project.
I think the shift first started with the ascendancy of native mobile apps. Now, developers had to seriously start considering their HTTP APIs as first-class citizens and not nice-to-haves. Once that happened, it's not a big leap to realize that treating your web application as somehow different from any of your native clients is a bit, well, insane. You can either choose to write a server that is a mix of JSON API and rendered HTML, with conditionals all about trying to figure out the right thing to render, or you can pull all of that logic out into a stand-alone JavaScript application, with better responsiveness to boot.
I think this approach is a winner. The server guys can focus on building a kick-ass server, and the front-end guys can build an awesome UI without having to muck about in the server bits.
One thing that still blows my mind is how hard it still is to get data from the server to the client. Everyone is writing custom code specific to their app. As the article says:
There's no reason for us to all separately think about these problems and solve them in a million different ways every time we're confronted with them. Aside from the years of wasted time this involves, we've also got a bunch of non-standard and sub-standard APIs to interact with, so all the client code needs to be custom as well and nothing is reusable.
I think this is a huge problem, and Yehuda and I are doing our part to try to solve it. Our Ember Data framework (http://github.com/emberjs/data), by default, assumes certain things, such as the names of your routes and how associations should be loaded. We want to enable people to start building apps right now instead of writing hundreds of lines of JavaScript that are custom to their application, and do it in a sufficiently comprehensive way that you very rarely need to drop down "to the metal." For example, we handle things like mutating associations on the client-side even before a guid has been assigned to a record.
Personally, I'm excited for how this is going to all shake out. I think Rails will continue to be an important piece in the toolchain, but it will no longer be the primary one, and I can't wait to see how it evolves to fill that role.