users@jax-rs-spec.java.net

[jax-rs-spec users] Re: [jsr339-experts] Re: MVC

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Mon, 2 Jun 2014 01:26:11 +0200

Hi,

On Fri, May 30, 2014 at 9:11 PM, Bill Burke wrote:

> I am 100% against MVC in JAX-RS. Are we really going to introduce a
> legacy and now defunct pattern to JAX-RS? The trend and future is Angular
> JS or GWT apps with simple RESTful back ends.


I'm personally not of the opinion that AngularJs is the definite future.
While I appreciate its place in the toolset that's available to developers,
IMHO there are tradeoffs between a single-page application and individual
pages, and between JSON that after arrival on the client still needs to be
processed and transformed before it can be rendered vs ready-to-render
HTML. But, while an interesting discussion itself, this might not be the
best place to discuss it ;)

However, what is interesting here is that the action oriented pattern (and
then as it seems more or less specifically in the way that Spring MVC
implements it) is just one of the many approaches.

Obviously component based (MVC with pull semantics) has a big share of
fans, as JSF often ranks highly in surveys and sees much activity on e.g.
SO. As one of the developers of the OmniFaces library for JSF I often get
feedback that people like the work we do and like working with JSF. The
pattern also has a couple of other representatives like Wicket and
Tapestry, which each have their own share of fans as well.

But as Bill points out here, there's also AngularJS and with it a whole
slew of client-side frameworks like it (in fact, there seems to be a new
one every few weeks). Clearly this approach has its following just as well.

Then there's yet another model which is about largely abstracting from HTTP
and HTML and building web UIs with pure Java in a style similar to
Swing/AWT/SWT etc. I'm not too familiar with Vaadin, but if I'm not
mistaken it's of this category.

Next to that there are some things like Node.js, which focus on
asynchronous processing above all.

What I not rarely see is that fans of one approach dislike the other
approaches, and in some cases may be very vocal about it. Maybe it's from
this advocacy that the feeling has arisen that Java EE needs an "MVC"
framework (actually "action oriented" framework). But if this is indeed
added to Java EE, wouldn't the next advocacy group ask for a Vaadin clone?
And then for a Node.js clone, etc? Where does this end? Java EE including
clones of each and every type of other framework?

While I think it can definitely be worthwhile to investigate how JSF can
further benefit from action oriented concepts (i.e. in the way that e.g.
Scala married functional and object oriented concepts), I'm not sure it's
really the best idea to have one or even more standalone (as in: fully
separated from JSF) additional web frameworks in Java EE.

Kind regards,
Arjan Tijms