Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Would You Use JSF for Your Next Project?

DZone's Guide to

Would You Use JSF for Your Next Project?

With JavaScript-based frameworks dominating much of the web development world these days, is Java EE's JSF still relevant, and should you use it for your next project?

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

There was an excellent StackOverflow blog post last week about the “Brutal Lifecycle of JavaScript Frameworks”. The article was about the speed at which JavaScript UI frameworks (Angular, Jquery, and React) come into and fall out of fashion. The key metric for this post is questions per month on the framework, which is a reasonable metric to demonstrate these trends. Downloads would have been interesting too.

It got me thinking: Where are we with JSF? And my starting point was to superimpose JSF on top of the JavaScript data.

Its hard to see clearly but JSF is in decline based on questions asked on StackOverflow. If we remove JavaScript, we can see the decline started around 2013:

That said, the level of questions is fairly small, and the level is relatively stable.

This post tries to understand the current state of JSF, and whether there is still a place for JSF in modern development.

What Is JSF?

JSF is a component-based web framework that is part of Java EE. It was the only frontend framework under Java EE until Java EE 8 added its new MVC framework.

What's Good about JSF?

For me, the key strength of JSF lies in the component frameworks in the JSF ecosystem — in particular, PrimeFaces or the utility libraries like omnifaces. They let you quickly get started on projects, have plenty examples, and are especially suited for a team or for projects where developers lack frontend skills. The deployment model is often simple, with a single WAR or EAR file per server

The current release of JSF is 2.3, with the specification for 2.4 currently in progress.

What's Bad about JSF?

In 2014 JSF received criticism from the ThoughtWorks TechRadar, which placed it on hold.

The main part of the criticism was that the JSF model is flawed as it...

“encourages use of its own abstractions rather than fully embracing the underlying web model”

They do make the concession that the web model is getting more prominence in later versions of JSF.

There were rebuttals against this post, particularly relating to more recent JSF versions, but it has contributed to JSF being regarded as a difficult framework to use.

JSF Is Marmite

JSF is the marmite of frontend development.

What's marmite? It's a yeast extract that you spread on toast. Some people love it, some hate it, but there is no middle ground. For the record, I hate marmite, but I like JSF.

The reason I like JSF is that you can access good quality components that are mature and well-documented. It also has the advantage of allowing teams that are weak on frontend skills to develop professional looking websites. There is a downside in that it can be hard to deliver more complex requirements as the Request/Response model is more abstract under JSF.

Should You Use JSF for New Projects?

The JSF model has fallen out of favor. It is viewed as a legacy framework against today’s JavaScript frameworks with RESTful API backends. This has moved Java toward implementing RESTful microservices. This approach can often scale better than JSF.

The StackOverflow blog post shows it's not all plain sailing in the frontend JavaScript world. The frameworks suffer from relatively short lifespans, and although there are migration strategies, you do run the risk of your javascript framework being obsolete.

JSF has the advantage of being a mature model in this respect. It's also worth remembering that if your team is lacking in frontend skills, then JSF will help you quickly deliver a professional-looking website.

Question

I’d be interested in hearing other peoples experiences, and whether they will be using JSF in future projects.

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:
java ee ,java ,jsf ,front-end development ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}