Compare each of the advantages and disadvantages between JSF and Struts

xiaoxiao2021-03-06  85

More >>> http://www-900.ibm.com/developerWorks/cn/wsdd/library/techarticle/0407_barcia/0407_barcia.shtml

JavaServer Faces used to be one of the most optimistic technologies in J2EE Web development. In WebSphere Studio, JavaServer Faces is already available. JavaServer Faces (JSF) provides new ways to visual development J2EE web applications.

Q: This is a very basic problem. Can you compare the advantages and disadvantages between JSF and Struts? How to learn about the current and future technical trends, how JSF and whether it will develop better technology than Struts. In addition, if WSAD can make both different words, it will act as the role in both.

A: This is a problem that is very popular in the near future. In general, JSF is still quite new techniques and requires time to completely mature. However, I saw that JSF can have anything that Struts can do, and more. Struts is not from mandatory needs. It is created by developers who are tired of writing the same logic. The emergence of JSF is both an inevitable need to be a result of competition.

Struts has the following advantages:

Struts is a mature, confirmed frame. It has been used for several years and is successfully deployed into many projects. The WebSphere Application Server Management Console is a struts application. Struts uses Front Controller and Command mode to handle complex controller logic. In addition to the core controller function, it still has many other advantages, such as using Tiles layout, Declarative abnormal processing, and internationalization.

The following is a disadvantage:

Struts is very JSP-centric, you must use other frameworks to adapt to other view technology. Although Struts has a rich tag library, it can only help development in controller, and it doesn't make any sense when you process components about the page. Therefore, from the perspective of the view, it does not provide good tools. Struts requires knowledge about JavaTM. Its purpose is to help Java developers, rather than hiding Java. It is not good to do this for web developers' detail of the Java language. ActionForms is a Struts framework link. Therefore, in order to reduce the coupling of the model, you will need to write a transfer code or use the tool when entering the data to move the data from the action forms to Model.

JSF is developing from a few frames including Struts. Struts founder, Craig McClanahan, one of the leaders of the JSF specification. Therefore, it is not accidental to see some similarities between Struts and JSF. One of the main purposes of JSF is to make J2EE web applications easily develop in RAD tools. Similarly, it also introduces a rich component model. JSF has the following advantages:

JSF is a specification from Sun® will be included in the future version of the J2EE specification. All major suppliers ensure strong support for JSF. JSF uses Page Controller Pattern, so it will help the page intensive application. The corresponding components respond to events from the components from the page. JSF has a clearly defined request lifecycle to ensure the plugability at different levels. A powerful example of the insertable is to build your own render toolkit. It has achieved good scalability in the ability of the rendering section and the controller part of the controller. Components vendors can write their own toolkits to handle different markup languages, such as XML or WML. In addition, the Render toolkit does not depend on JSP. Because JSF has a rich component model, it supports development of RAD types. Now I can use drag and drop technology to build my web page. In addition, JSF provides a way to connect the visual components with the background model assembly without breaking the hierarchy layout. JSF has the following shortcomings:

JSF is still quite new and in development. It takes a while to see successful deployment and extensive applications. In addition, component suppliers may not do everything you want to complete. Handmade JSF is not simpler than Struts. Its goals are more inclined to RAD. Those who like to be manually developed (for example, those who don't like the IDE) may find that Struts is easier to develop. Struts navigation may be more flexible, but also causing controller logic more complicated.

JSF and Struts will continue to coexist. The Struts community has already learned JSF and made some changes to provide powerful support for JSF. See What about JSTL AND JAVASERVER FACES?

At the perspective of tools, if you pay attention to WebSphere Studio's tool support for JSF and Struts, the Struts tool will be found in the controller. The Web Diagram editor helps build your Struts configuration and the Wizard / Editor builds the Struts component. The JSF tool is suitable for building a page, while the JSF framework is hidden in substantially. WebSphere Studio can be expected to support both frameworks. When JSF is mature, it is expected that some controller can be seen in JSF.

转载请注明原文地址:https://www.9cbs.com/read-122175.html

New Post(0)