现在的位置: 首页 > 综合 > 正文

如何选择web应用程序框架,三篇文章

2013年09月08日 ⁄ 综合 ⁄ 共 5849字 ⁄ 字号 评论关闭
文章目录
http://raibledesigns.com/rd/entry/re_what_web_application_framework
RE: What Web Application framework should you use? Tim O'Brien has an interesting post titled What Web Application framework should you use?. The first thing I noticed about this post is the permalink. It looks like he started with "Isn't Rails supposed to change...", which makes me wonder what the rest of the title was. In this post, he rags on Java Web Frameworks and the lack of a clear path for choosing one. He ends up predicting that many will stick with Struts 1.x (poor bastards) and those that aren't tied to Java should move to Rails. I don't have a problem with folks moving to Rails, but I would like to comment on the Java Web Framework space and Tim's comments.

He says:

Prediction: The confusion over what is happening over at Struts is going to discourage people from continuing to use it. The Struts team did the right thing in recognizing that Struts 1.x was a dead-end, but that project needs a single public message. Is it Struts Action or is it Struts Faces? Or is it two frameworks capitalizing on the Struts brand name?

I think what is going on in the Struts project is definitely two frameworks capitalizing on a brand name. That was a concious choice on the project's part when they chose to start creating sub-projects. The interesting thing about Struts Shale is it's largely a prototype for JSF 2.0. Furthermore, it was rejected by many Struts developers as becoming Struts 2.0. Why? Because JSF sucks. Especially when used with JSP - which is what most folks are doing.

JSF continues to be the most over-hyped under-used framework in Javaland. If you read the blogs of first-time users, you'll find many complaints and issues on how things work. Granted, most of these problems are with JSP and the implementation, but still. If I were in charge of JSF, I'd dump JSP altogether, bundle Facelets with it and allow more flexible page navigation (including controller-to-page). Don't get me wrong, I like the ideas behind JSF, I just don't like the implementation (or the fact I have to wait years for things to be fixed in the spec).

That being said, I've yet to meet an unhappy WebWork fan. If you find someone that still likes Struts, ask them if they've used WebWork. Chances are they'll say no. As far as Tapestry is concerned, the learning curve is too high. It's been rejected time and time again by my clients because of the learning curve. Are they going to fix this? Yep, they're going to re-write the whole damn thing - again! Every major point release of Tapestry throws backwards-compatibility out the window. Furthermore, I've heard once you get over the learning curve, it's a joy to work with. I've also met people at conferences that've used it over a year and say they're still struggling with its concepts.

Spring MVC - I wish I had bad things to say about it, but I don't. It (obviously) has the best Spring integration, but I've found WebWork much more pleasurable to work with. Sure, Spring has a ThrowawayController, but with a name like that, you can tell it's a second-class citizen.

Inspired by Tim's post, here's my prediction:

Struts Action 2 will be the best choice for developing Java-based web frameworks. Not only does it support JSF, but it's easy to learn, test and use. Furthermore, it seems to be the most often used framework in major software products and web sites.

How's that for a clear message? Struts Action 2 is the shiznit, now let's get back to developing applications.

Disclaimer: This is my opinion with a lot of stuff thrown in to get folks riled up. I've never put a JSF, Tapestry or Spring MVC application into production (except for AppFuse of course), so most of my opinions are likely without foundation. In wonder how many applications Mr. O'Brien has put into production with these frameworks?

http://www.virtuas.com/articles/webframework-sweetspots.html
Java Web Framework Sweet Spots - By Matt Raible
This document was compiled by asking a number of different Java web framework authors the following questions:

 

1. What is your framework’s “sweet spot,” and for what type of projects should it strongly be considered?
2. What type of scenarios does it not fit in to? Would you recommend another framework in this scenario? If so, which one?
3. Of the other web frameworks mentioned below, have you tried any of them? If so, which ones, and what did you like about them? What didn’t you like?
4. What is the future of your web framework? What’s coming that’ll make it easier for users to develop with? Do you support Ajax natively? If not, are you planning on adding support?
5. Are there myths about your framework you’d like to challenge? If so, which ones?
6. What do you think of Ruby on Rails?

 

The frameworks represented in this paper and their authors are as follows (in alphabetical order):

JSF, Jacob Hookom
RIFE, Geert Bevin
Seam, Gavin King
Spring MVC, Rob Harrop
Spring Web Flow, Rob Harrop and Keith Donald
Stripes, Tim Fennell
Struts Action 1, Don Brown
Tapestry, Howard Lewis Ship
Trails, Chris Nelson
WebWork, Patrick Lightbody
Wicket, Eelco Hillenius

Download this document in PDF form by clicking on the link below.

Attachment Size
JavaWebFrameworkSweetSpots.pdf 256.57 KB

https://equinox.dev.java.net/framework-comparison/

Get ready for the java.net site upgrade beginning April 4th, 10 am PDT! Preview your project on the Upgrade Staging Site at http://stage.dev.java.net. Details and contest information here.

Introduction

Deciding which Java web framework to use when developing your applications can be a difficult choice. I've often wondered which one is "best" myself. Since 2004, I've been playing and developing with the top five web frameworks for Java: JSF, Spring, Struts, Tapestry and WebWork. For my most recent opinion on which one is my preferred choice, see What Web Application framework should you use?. You might also checkout the following whitepapers I've written at Virtuas:

Presentation

From my learnings, I've created a presentation that you can download (updated September 2006). This presentation will likely improve over time as I learn more about each framework.

The Code

While talking about how the different frameworks do things, showing how they do things is better. For this reason, Equinox contains implementations for a simple CRUD app using all 5 of the aforementioned frameworks. In addition, the download contains JUnit and UI tests for each framework.

See the QuickStart Guide for installation and build/test/deploy instructions. If you'd like, you can browse CVS for the code. Spring is the default web framework, the others are in the "extras" folder.

Demos

More Information

For more information about integrating these frameworks with Spring, as well as a detailed comparison, see Chapter 11 of Spring Live.

【上篇】
【下篇】

抱歉!评论已关闭.