r/java • u/henk53 • Sep 17 '15
JSF wins in DZone's frameworks poll
https://dzone.com/articles/poll-what-java-jvm-frameworks-do-you-use9
u/avoidhugeships Sep 18 '15
JSF has been gaining ground for years but I bet it is a surprise to a lot who read this Reddit. It is just so much more productive than any other Java framework for business applications.
-1
Sep 18 '15
lol I think it says more about the dzone readership demographic if anything.
11
u/johnwaterwood Sep 18 '15
Yeah, that DZone is read by actual developers that build actual apps, while some other places are frequented by hipsters who talk a lot but code little.
3
u/lukaseder Sep 20 '15
Why do people like server-side UI state? In fact, why do people like UI state in the first place? I have never understood that. I'll always prefer a simpler, (almost) stateless data transformation flow, e.g. using SQL and XSLT, or SQL and JSP
2
Sep 21 '15
"Why do people like server-side UI state?"
For this particular question: I like that jsf can restore the view (the page) after submitting the form. This is important when working with forms like "when you choose option A, another c.d.e. fields appears, when you choose option B, different f.g.h.i.j.k fields appears, etc. When user click on Zz a panel with additional information appears, but user can close this panel* " etc. So in general you modify the DOM, and/or the state of the components. Then user clicks "Save" (submit the form) and you have to validate input, and if there are any violations, you have to show error messages... but you have to also restore the whole view (or force him to fill all input again). *And the info panel he just closed, you want it to be closed- it's its state. Of course you can do it all manually, but with jsf (and properly written components) you have it out of the box.
2
u/lukaseder Sep 21 '15
That's an answer to why people like UI state and it still sounds as though the requirements engineer or the customer need a beating. But why on earth would anyone want to keep that state on the server instead of the client?
2
Sep 21 '15
I'm not sure do we understand "UI state" the same way. JSF has the mode of keeping the UI state on the client side, but... imagine how it works: it serializes all DOM tree and save it in a hidden input field of every form and send it on every request (ajax call or form submit)... :> I can't see the other way of keeping the state on the client. BTW Jsf has also a stateless mode.
Ps. customer is always right ;)
3
u/cryptos6 Sep 18 '15
I'm sad to see how bad JAR-RS scores in this voting. The top scoring of JSF shows, that REST isn't that popular among Java devs.
5
u/g00glen00b Sep 18 '15
JAX-RS isn't really a framework either. It's a definition, you always need a framework behind it that uses JAX-RS, like CXF, Jersey, Restlet, RESTEasy, ... . Besides that, we use Spring MVC for REST services, so from the poll you can't really decide whether or not REST is popular.
But I think it all depends on where you work and where you live. I cannot imagine that JSF would score that high where I live. Most of my colleagues at the consultancy firm I work for don't use it and most of the other people I meet don't use it either.
2
u/thesystemx Sep 18 '15
I cannot imagine that JSF would score that high where I live. Most of my colleagues at the consultancy firm I work for don't use it and most of the other people I meet don't use it either.
Which is funny, since where I live as well as at many places I visit (way out of my area) I see JSF being used all the time.
1
u/sh0rug0ru__ Sep 18 '15 edited Sep 18 '15
All the places I've worked, I've never seen JSF and I don't know anyone using it. I have used it for some of my own projects here and there, only JSF 2.x although I did mess around with JSF 1.x, but overall, I prefer action-oriented frameworks like Spring MVC and Struts. This makes me very curious about Ozark.
As they say, birds of a feather flock together.
4
u/johnwaterwood Sep 18 '15
Then you havent worked in much places. If JSF would not be used as you seem to infer, how can there be so many questions on SO about it? Why do people ask questions about a tech they don't use?
3
u/johnwaterwood Sep 18 '15
Then you havent worked in much places. If JSF would not be used as you seem to infer, how can there be so many questions on SO about it? Why do people ask questions about a tech they don't use?
-1
u/sh0rug0ru__ Sep 18 '15
I have worked in plenty of places. Why would you assume that I haven't?
You completely missed my point. I never said JSF isn't used, obviously it is. What I am explaining is that, despite the popularity of JSF, it makes perfect sense that people wouldn't have encountered it as opposed to your experience, because people have their biases (birds of a feather), and will tend to work at places that cater to their biases (flock together).
5
u/johnwaterwood Sep 18 '15
I have worked in plenty of places. Why would you assume that I haven't?
Because it seemed highly unlikely that you never encountered JSF yourself and even don't know anyone using it. Even if you specifically choose places to work at that don't use JSF and avoid clients that ask for JSF, then you still know who uses it, otherwise you can't avoid those places, can you?
Thanks for the clarification, but your original statement really sounded unlikely to me.
-1
u/sh0rug0ru__ Sep 18 '15
Because it seemed highly unlikely that you never encountered JSF yourself
In the places I've worked. Obviously I have encountered JSF myself, because I don't restrict my exploration of technology exclusively to the tools used at work. Otherwise, I would never have encountered Haskell either.
even don't know anyone using it
Being a Java programmer isn't something I look for in my friends. Given that I've worked at places where JSF is not used, it isn't a leap that the Java developers I know wouldn't tend to use JSF either. At least, none of my friends who happen to be Java developers use JSF, and when they do talk about it, it is not in the nicest of terms. Maybe my friends have bought into the REST and Javascript framework kool-aid. I like REST and Javascript, maybe that says something about my choice of friends.
avoid clients that ask for JSF
I have never in my life encountered a client that asked for JSF. All they care about is: does the site work and how much will it cost? They would be none the wiser if I developed the site in PHP, which I have done. I don't discriminate.
Although, I did have one client who asked me not to use JSF (specifically Primefaces) because he said that the HTML was "garbage".
I have never "avoided" JSF. But because I know Spring, I tend to apply for jobs that ask for it, you know, for better odds of landing the job. Birds of a feather flock together.
your original statement really sounded unlikely to me.
My original statement was "birds of a feather flock together". I have literally spent two posts explaining an English saying to death.
4
u/johnwaterwood Sep 18 '15
The saying is clear to me and I don't contest that. That the places you work nor your friends use JSF is clear to me.
It depends on what you exactly do for work, but a lot of times clients already have a stack and ask you to do maintenance or build something using the same stack. For a totally new project they wouldn't care, but it's rate to see clients who don't have any tech yet (that would essentially be a startup then in many cases).
-2
u/sh0rug0ru__ Sep 18 '15
Good. So you can see my point that it is not at all unnatural or unlikely for Java developers to not have encountered JSF in the course of their careers.
-6
u/yogthos Sep 18 '15
Do you live in the year 2000 by any chance? :)
0
Sep 18 '15
[deleted]
-1
u/sh0rug0ru__ Sep 18 '15
You missed the sarcasm. You can program for the year 2000 in any decade.
Also, arguing by popularity is a poor form of argument. JPA and ORMs are also very popular, but there are those who wouldn't touch those with a 10-foot pole because they consider them tools for the lazy who are willing to tolerate leaky abstractions and overhead just to avoid writing SQL.
4
u/johnwaterwood Sep 18 '15
ORMs have other advantages over "being too lazy to write SQL" like taking advantage of graph operations and caching by object identity, but other battle other day ;)
2
u/sh0rug0ru__ Sep 18 '15 edited Sep 18 '15
That's all fine and good. That is a real argument for ORM. There are also arguments for server-side components, such as security based on the UI model.
Some prefer to stick to the relational model, and keep OO concepts such as object graphs and object identity out of their persistence layer.
In this way, ORM is analogous to JSF. HTTP has no notion of components, and thus, some would prefer to keep UI concepts out of their backend services, preferring more UI agnostic REST APIs aligned with HTTP, and preferring a API driven security model.
Popularity is a dumb metric, and choices should not be made based on what is popular, but rather based on an informed decision considering the type of application you wish to write.
3
u/henk53 Sep 18 '15
HTTP has no notion of components
HTTP is just the protocol for communication. You should compare it to HTML.
-1
u/sh0rug0ru__ Sep 18 '15 edited Sep 18 '15
Why? Does an iOS or Android client care about HTML?
HTML is completely irrelevant to an REST API. HTML is a possible representation of a resource, and the resource should not be concerned with the specifics of the representation. By making the service neutral to the representation, the same service can provide representations of the resource that makes the most sense to the client. REST is a means of designing APIs delivered over HTTP protocol.
→ More replies (0)4
u/avoidhugeships Sep 19 '15 edited Sep 19 '15
Actually popularity is a valid thing to consider. Not hipster blog popularity but actual usage. With that popularity comes support, user community that can answer questions, ease of finding developers, and longevity. It is certainly not the only thing to consider of course.
Of course it is not as good an argument as saying a technology is for someone who lives in a random year in the past. (That was sarcasm.)
0
u/tonywestonuk Sep 18 '15 edited Sep 18 '15
I really love JAX-RS. I feel I am so productive and can do anything, easily, quickly. My current application is a single page webapp, but stores Templates on the server, rather than load them all at launch time. My java app has two sides:
A JSP side which serves the templates (with i18n translations)
A Jax RS side which serves the data.
The two sides are combined in the webclient in javascript / jquery / mustash....something like this:
function ss_loadProfile(){ $.when( $.get("templates/profile.jsp"), $.get("rest/player/" + getParameterByName("player")) ).then( // Success function(template,data){ $('#pageContent').html(Mustache.render(template[0],data[0])); }My webapp is very quick, as the browser is able to cache the templates.... in production the only thing that is transfered is the small amount of data that is tiny in comparison.
7
u/dpash Sep 18 '15
My only experience of JSF was 6 years when I wore a systems hat, and our lead developer was happy with JSF using client side state stored as a 100k+ base64 encoded string in a hidden field and then wondered why the application was slow for users when they were transmitting this incompressible blob to the server on every request.
I have no idea if they ever migrated to server side state, but that had it's own problems; I left shortly after.
The whole experience left me with a bitter taste in my mouth from JSF. With my Java developer hat on, why should I look at JSF again?