Web framework comparison

Source: Internet
Author: User
My blog hasn't been updated for a long time. I 've been busy with a new project recently. I 've tried a lot of new practices in this project, and I want to collect them and add them to my blog. Here I will first write an article about the Web framework, it is basically a repeat of the old call. this article was written in April to discuss issues with friends. It may be incorrect in some places.

 

Struts

JSF

Tapestry

ASP. NET

Architecture

Jump Model

MVC

Jump Model

Front Controller + componentized Programming

Page Model

Page controller + componentized Programming

Page Model

Page controller + componentized Programming

Programming Model

Business logic:

The base class must be inherited in struts1; struts2 is a pojo model;

Page logic:

Different implementations can be JSP or template engine rendering.

Business logic:

Pojo programming style;

Page logic:

Mainly JSP, or HTML style.

Business logic:

Taperstry4 needs to inherit the base class, but taperstry5 is the pojo style;

Page logic:

Common HTML.

Business logic:

The base class needs to be inherited;

Page logic:

Similar to JSP, but the difference is that the page is actually a subclass of the business logic class.

Request Process

 

Consists of six officially defined steps;

Depends on the engine service.

Consists of 15 officially defined steps.

Navigation

The path is bound to the action, and the configuration file must be parsed.

Done through the faces-config.xml configuration file.

The URL is global and there is no additional configuration file;

Unless explicitly redirected, all actions are performed on this page.

There are two types of redirects:

1. directlink is written on the page

2. Define the page Jump logic in code logic.

Similar to tapestry.

Event handling

None

The page definition event is initiated. Two parameter passing methods are available: one is separated and the other is passed through facescontext.

Page-defined event initiation; directly assign parameters without restrictions on the number of parameters; in addition to built-in lifecycle-related events

It is similar to the swing event control method.

Component state

None

There is no status maintenance mechanism, and each request starts from component creation.

Provides a maintenance mechanism for component status.

Provides a maintenance mechanism for component status.

Component Dev

None

JSP tag-based development.

The development method is similar to page. The logic code and page are separated, and the page output uses HTML.

The development method is similar to page; logical code and page separation; page output can reuse existing components

View

Different implementations can be JSP or template engine rendering.

Mainly JSP, or HTML style.

Html

Similar to JSP pages.

Validation and conversion

 

It provides support in multiple ways, but the client verification support is not good, and the support at the form level is not good, usually needs to be customized by the project.

It also provides support in multiple ways; in addition, it provides client validation; it naturally supports form-level support.

Similar to tapestry.

I18n

Better support.

Better support.

Excellent support and additional preview functions.

 

Testability

The struts1 test is not easy, and the strut2 test is easy.

Test support is simple and easy.

The test of tapestry4 is not easy, but the test of tapestry5 can be very simple.

It is not easy to test.

Extensibility

 

Good

Good

Good

Industry momentum

Widely used, all kinds of resources are good at present.

JSF industry standards, industry vendors support a lot, but may not end with ejb2.

The application scope is smaller than struts, and the learning curve of previous versions is too high.

A large number of third-party companies provide support.

Migrate

 

It is not difficult to migrate from struts;

It is more difficult to migrate data from struts or JSP.

 

For work reasons, we have been using spring web flow recently. The advantages of the above Web frameworks are as follows:
1. the page process is clear. Except for JSF, it is not easy for other frameworks to explicitly obtain the page process information. for enterprise development, this is actually very important. general Internet websites have no special benefits.
2. you do not need to write web control classes such as action. although struts2, JSF, and tapestry are both pojo, there are still classes in the web layer category. Spring web flow does not need to be written in the flow file and directly accesses the service object, obtain the domain model (we also omit VO ). of course, some people may disagree. the benevolent sees benevolence!
3. Spring web flow provides unit testing to easily cover the page flow.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.