What are the main disadvantages of Java Server Faces 2.0?

前端 未结 13 2226
猫巷女王i
猫巷女王i 2020-11-22 06:29

Yesterday I saw a presentation on Java Server Faces 2.0 which looked truly impressive, even though I am currently a happy ASP.NET MVC / jQuery developer. What I liked most a

13条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 07:06

    After 5 years of working with JSF, I think that I can add my 2 cents.

    Two major JSF drawbacks:

    1. Big learning curve. JSF is complex, that's just true.
    2. Its component nature. Component-based framework tries to hide the true nature of the Web, which comes with a huge amount of complications and disasters (like not supporting GET in JSF within almost 5 years).
      IMHO hiding HTTP Request/Response from the developer is an enormous mistake. From my experience, every component-based framework adds abstraction to the Web development, and that abstraction results in unnecessary overhead and higher complexity.

    And minor drawbacks that come to my mind:

    1. By default ID of the object is composed of its parents' ids, for example form1:button1.
    2. No easy way to comment-out incorrect page's fragment. Tag needs syntactically correct content which is parsed anyway.
    3. Low quality 3rd party components which e.g. don't check isRendered() inside processXxx() method before continuing.
    4. Incorporating LESS & Sencha is hard.
    5. Doesn't play well with REST.
    6. Not so easy for UX designers, because ready-to-use components have their own CSS styles, that need to be overwritten.

    Don't get me wrong. As a component framework JSF in version 2 is really good, but it's still component-based, and always will be...

    Please take a look at the low popularity of Tapestry, Wicket and low enthusiasm of experienced JSF developers (what is even more meaningful). And for contrast, take a look at the success of Rails, Grails, Django, Play! Framework - they all are action-based and don't try to hide from the programmer true request/response and stateless nature of the web.

    For me it's major JSF disadvantage. IMHO JSF can suits some type of applications (intranet, forms-intensive), but for real-life web application it's not a good way to go.

    Hope it helps somebody with his/her choices that regards to front-end.

提交回复
热议问题