`
honley
  • 浏览: 116994 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

我为什么重新考虑JSF

阅读更多

原文地址:http://blog.brunoborges.com.br/2013/01/reasons-to-why-im-reconsidering-jsf.html

 

In December 2010, I wrote a blog post entitled "Top 10 reasons why I don't like JSF", and I would guess that 50% agreed with me, the other 50% did not. No surprise, it's like religion.

I always liked to research products, projects, frameworks and Java technologies in general, but specially in the Web Development area. In 2001, I started coding JSP and Servlets, just a few months after I learned how to program in Java and do OOP . Did my first web application connecting to an Oracle DB with pure JDBC. Learned from the basics, on my own and succeeded.

Later I got a new job, thanks to my experience in Web Development, but my employer was using Apache Struts. I knew about that upfront so I studied it before my interview. Got hired. Struts back then, wasn't that hard for someone already with knowledge about HTTP request/response architecture and the Servlet specification. Then came JSF 1.0. I didn't like it. Complex. Way too much. Struts was much simplier. JSF 1.1? Same thing. Small improvements only.

So I moved to something different. In 2007, I heard about Apache Wicket. Then I became an independent evangelist. I gave several talks in Brazil, for years, spreading my word about Wicket, at every conference my talk was approved. I even created a community, Wicket em Português, for Portuguese speakers. I also offered an online training for it. I was offered a job proposal just because I knew Wicket, in Rio de Janeiro in 2010.

Now, the reason I told you all this is to show you that I'm used to choose what works best for me, at a certain time. I do change my opinion over things. It's something like, readaptation. We all should readapt. Every time. Just to demonstrate: I was born in an island, Florianópolis, then I moved to São Paulo, later I moved to Rio de Janeiro. Now I'm back to São Paulo. My accent changed, thanks both because I like to talk like others to make jokes, but also to feel like a local. By the way, I'm a CouchSurfer. I enjoy traveling and being with, and like, locals.

Now let's get to the real thing: Java Server Faces 2.2. The version that is leading me to readaption.

Before start, I should point that I now work at Oracle and I advocate in favor of Java EE. I'm friend of Arun Gupta, Reza Rahman, Ed Burns and several other folks who are Java EE advocates, also some who are not Oracle employees.

When I wrote about the things I didn't like in JSF, some were technical, others were related to its ecosystem and the market. Things that change, that evolve. And they did.

1. Pure HTML
I talked to Ed Burns several times about the way we design pages in JSF, with tag libraries. At the first opportunity, years before joining Oracle, I told him: "Hey, why don't you make it look like Wicket?". Facelets came at some point between that day and later. Now, in JSF 2.2 it's possible to define a page using pure HTML, letting the browser do the preview without much hassle. Something I enjoy a lot in Wicket and other frameworks. Something I talked a lot at my presentations. So here it is, the community (represented by myself and many others), influencing change in an specification.

2. Implementations
I think that relying on whatever is running on your application server (Mojarra or MyFaces) is better. If you are considering JSF, you should choose a Java EE certificated app server and just use whatever comes within. Life will be much easier this way.

3. Creating custom components
In JSF 1.x, creating a custom component was more difficult than creating YAJWF. Now is a one-file-in-a-directory only. It's very easy to compose a custom, reusable component. This post will give you an idea.

4. Documentation
I used to complain about JSF documentation (fragmentation). Apparently, documentation got a lot better. The Java EE 6 homepage at Oracle offers hundreds of pages of documentation. Of course you can always look somewhere else for docs, but I would go to these first, as these are the "official" docs, much like when you go to SpringSource for Spring MVC documentation.

5. Tooling Support
I've been playing with NetBeans for quite a while and it is a good IDE for Web development. But if you are really into HTML5, then you will like JSF inside NetBeans. The IDE now provides a feature, from Project Easel, that integrates with your browser and provides debugging and many other features. Good for someone doing HTML5 development with JSF 2.2 and JAX-RS. By the way, there is some work going on, according to Ed Burns, on integrating JSF 2.2 and JAX-RS 2.0. So let's keep an eye on that.

6. Other new features
Some otther new features are about to come as well. Here are some tickets in JIRA that are being prioritized, like:

  • Loading Facelets through ResourceLoader
  • Ajax File Upload component
  • Cross Site Request Forgery Protection
  • Faces flows


99. Java EE advocate
I always was an advocate of the platform though never of all of its specs. And one of the reasons I took the job at Oracle as Product Manager, was because I have been working with Java EE since... ever. Not with JSF specifically I confess, not always, but I was already considering it since it turned 2.0. And facing the challenges of teaching developers to do non-Java EE development the right way, I had been thinking of adopting it fully, simply because it's easier to find skilled developers of the platform. This is a great deal for employers when their time-to-market is important.

Still... some gaps
If there's something that I still think that happens, is the compatibility between implementations. The TCK does not cover everything, because of gaps in the spec. So it's not guaranteed to say that a project running with PrimeFaces or RichFaces on top of Mojarra will run just fine if you move it to an application server running MyFaces. But this is something that can be fixed, and I'm sure it's being addressed by all parties (JSF EG, myfaces-devs and mojarra-devs).

Also, it would be nice to see more things like server-side UI programming, as it happens with Apache Wicket. Maybe even having support for different languages? It would be nice to have the server-side UI logic in Javascript, for example. :-)

Java EE 7 and the future
Non standard frameworks are good for innovation. Some may not agree, but JCP and standards are not that slow anymore. Of course they still are if you compare to stuff like Node.js, Wicket, Liftweb, Play!, Rails and other great alternatives for web development. But look at JSF 2.2 and Java EE 7. We are about to see the new version of Java EE about the same time as HTML5 comes to a final version. In old days, it could be like having Java EE supporting HTML5 in... what? 2018? Not anymore.

Also, if you want to use JSF with CDI, you should really consider an application server with at least Java EE Web Profile, like Apache TomEE. Oracle GlassFish and JBoss are another option if you are looking for open source solutions. The reason to choose a compliant Java EE app server is that they already offer (and test) these kinds of integrations (e.g. JSF with CDI).

So yes, I look forward to Java EE Platform 7.0, not only as an advocate, but specially as a developer. I'm seeing its value, its improvements, and its readaption to the market.

Openness to Change
Let's not forget, the Adopt-a-JSR program offers the community, a great opportunity to participate, speed up, and improve even more the platform and all of its specifications. So here's your chance to ... why not, fill the gaps? :-)

Cheers!

分享到:
评论

相关推荐

    JSF基础教程 简体中文

    藉由以下的几个主题,可以大致了解JSF的轮廓与特性,我们来看看网页设计人员与应用程序设计人员各负责什么。 o 简介JSF o 第一个JSF程序 o 简单的导航 Navigation o 导航规则设置 o JSF Expression Language o 国际...

    JSF入门级资料 学习笔记

    而JSF技术正是为了解决以上的问题,从界面人员、应用程序开发人员,组件人员三个角度来考虑,统一各种标签和框架,可以让这三类人员可以彼此合作又互不干扰。 本文是JSF入门资料的学习笔记,或许对您有一些帮助。

    java server face 教程

    与应用程序设计人员各负责什么。 o 简介 JSF o 第一个 JSF 程序 o 简单的导航 Navigation o 导航规则设置 o JSF Expression Language o 国际化讯息 • Managed Beans JSF 使用 Bean 来达到逻辑层与表现层分离的目的...

    C#课程设计-C#大作业基于ASP.NET技术的动漫管理系统源码(老司机驾驶舱).zip

    通过ORM框架实现数据访问层,并将数据库操作服务封装为DAO层; 通过razor页面的背板代码实现业务层,它面向业务外观,将多个DAO层组织起来实现相关功能; 通过razor页面的前端标记库实现表现层,它调用背板代码提供...

    P06:工作 - 这个 P06 是 P05 的补充,但它隔离了 Algaworks 书中的一些练习,例如

    Java EE 7 with JSF, PrimeFaces 和 CDI by Thiago Faria 12/24/2013 版 完成了书中的练习工作! 感谢阿尔加工厂! 非常好 ! 这个P06和P05一样,只是从Algaworks的书里分离了一些练习,比如:Livros.xhtml,...

    基于Ajax的新MVC框架的研究与实现

    新框架的请求处理流程借鉴了JSF的请求生命周期,但对它进行了改造,从而简化了流程。本文还将Java反射机制与Velocity技术相结合,实现了在VTL文件中直接存取Container的相关属性。由于引入了jQuery,极大简化了DOM以及...

    蝙蝠论坛系统 v1.1.rar

    蝙蝠论坛是基于JSF2 Spring3 JPA2等JAVA技术构建的一个小型论坛系统,内置了无处不在的AJAX能力,简洁易用,功能涵盖版面管理、版主设置、发贴、回复、置顶、屏蔽、内部邮件等常用论坛功能,既可以作为非商业性的...

    java初学者的工具ppt文件

    估计选择Java EE方面的学习者会多一些,JavaEE所涉及技术非常多,考虑到初学者的接受程度,我会尽量从最常用的角度来介绍。 学习Java EE,在开发环境上不建议再用文本编辑器,我感觉NetBeans 5.5(目前最高正式版本)...

    RedSocialSecret:Sistema Red Social发行版,PHP版本8,Bajo elpatrónMVC(Modelo-Vista-Controlador),MySQL,AJAX,JQuery,Javascript

    决定是否需要考虑。 Idealmente establecerlo市长损失40MB。 蒙古国的无产阶级保护组织,自治市的无产者,市长的儿子和无产阶级的受权保护者。 不动产,永久物和不当行为,不动产,不动产和不动产的事实。 曼特拉...

    struts2权威指南全版(分10部分)

    目前,基于Web的MVC框架非常多,发展也很快,每隔一段时间就有一个新的MVC框架发布,例如像JSF、Tapestry和Spring MVC等。除了这些有名的MVC框架外,还有一些边缘团队的MVC框架也很有借鉴意义。 对于企业实际使用...

    在ApacheTuscany上开发基于SCA的Web2.0应用

    许多传统的JavaEE产品和框架也在越来越多地引入这些Web2.0技术,如Struts2和JSF都有了越来越完善的Ajax扩展,Portal产品中也基于Dojo等javascript框架引入部分刷新等机制,大幅提升了性能和用户体验。可以看出,Web...

    rdi:具有React能力的依赖注入库,由Reactor提供支持

    什么是RDI? RDI代表响应式依赖注入。 它是一个库,允许通过定义它们的依赖关系来管理应用程序中存在的bean,服务和任何类型的Java对象的实例化。 RDI的特殊性在于它完全支持所定义的React式编程范例,从而可以通过...

    Spring基础与快速入门

    1 非侵入式:对于写代码从来不考虑复用和移植的程序员来说,这一点根本就没有吸引力,那么请跳过。所谓非侵入式是指Spring框架的API不会在业务逻辑上出现,也就是说我们的业务逻辑应该是纯净的,不能出现与业务逻辑...

    Curtin Final Distance-crx插件

    它具有将通勤时间考虑在内并阻止一周中某些时间的功能,可确保您在工作或其他承诺中不安排课程。 它创建了所有可能的班级组合,并让您从十个(或更多)距离最短的时间表中进行选择。 距离是对课程表的分数,计算方法...

    Hibernate实战(第2版 中文高清版)

     1.4.3 为什么选择ORM   1.4.4 Hibernate、EJB 3和JPA简介   1.5 小结   第2章 启动项目   2.1 启动Hibernate项目   2.1.1 选择开发过程   2.1.2 建立项目   2.1.3 Hibernate配置和启动   2.1.4 ...

    DouglasJuniorTCC:GitHub数据挖掘和测量软件

    整个工具将使用JAVA语言以及用于接口和GlassFish应用程序服务器的JSF框架(Java Server Faces)来实现。 选择用于存储信息的数据库是PostgreSQL,因为它是具有GPL(通用公共许可证)许可证的数据库管理器。 我们...

    本科毕业设计开题报告(食得客快餐店订餐系统的设计与实现)

    MyEclipse目前支持Java Servlet,AJAX, JSP, JSF, Struts,Spring, Hibernate,EJB3,JDBC数据库链接工具等多项功能。可以说MyEclipse几乎囊括了目前所有主流开源产品的专属eclipse开发工具。因此在开发本系统时我把它...

    TeamWork-JLU_info_sys:五个同性恋者共同努力,创造出伟大的事物

    s架构) EJB:将一些“类”放到甲服务器上,B服务器对甲服务器上的“类”进行远程调用和实现而不考虑网络方面的技术(用于大型企业分布式计算)JSF:的JavaWeb前端的一个框架,用于开发界面,某些在网络界面添加表格...

    本科毕业设计开题报告(计算机协会信息管理系统的设计与实现V5)

    MyEclipse目前支持Java Servlet,AJAX, JSP, JSF, Struts,Spring, Hibernate,EJB3,JDBC数据库链接工具等多项功能。可以说MyEclipse几乎囊括了目前所有主流开源产品的专属eclipse开发工具。因此在开发本系统时我把它...

Global site tag (gtag.js) - Google Analytics