各种 Java Web 框架的优缺点是什么? [英] What are the pros and cons of the assorted Java web frameworks?

查看:40
本文介绍了各种 Java Web 框架的优缺点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用 Java 创建自己的网站,并正在尝试决定使用什么框架.但是,快速搜索 Java 框架会返回 50 多个可供选择!

I am considering creating my own website using Java and am trying to decide what framework to use. However, doing a quick search for Java frameworks returns more than 50 to choose from!

我的网站一开始只是为了让我自己享受构建它的乐趣,但如果它变得流行,它有一些可扩展性,或者至少能够为此重新设计.

My website is just going to be for my own enjoyment of building it in the beginning, but if it becomes popular, it would be good for it to have some scalability, or to at least be able to redesign for that.

比较流行的框架之间的主要区别是什么?是否存在一个明显优于其他的情况?例如,高流量企业应用程序与低流量小型应用程序.我还想知道有些是否比其他的更容易学习和使用.

What are the main differences between the more popular frameworks? Are there instances where one significantly outperforms the others? For example, high-traffic enterprise applications versus low-traffic small applications. I'm also wondering if some are much easier to learn and use than others.

是否有人对其中一些框架有经验并可以提出建议?如此多的选择是否只是一种预警,可以避免在可能的情况下进行基于 Java 的 Web 开发?

Is there anyone who has experience with some of these frameworks and can make a recommendation? Does the sheer number of choices just serve as an early warning to avoid Java-based web development where possible?

推荐答案

我用过 Tapestry 3WicketEchoJSF广泛.我真的建议您仔细查看这些内容,然后选择对您来说最简单的方法,并且最适合您喜欢的工作方式.

I've used Tapestry 3, Wicket, Echo, and JSF fairly extensively. I'd really recommend you look those over and pick the one that appears the easiest for you, and to most closely fit the way you prefer to work.

其中,对我来说最舒服的是 Wicket,因为组件的轻量级特性页面模板的构建和简单性.如果您使用自己的数据库代码而不是 Hibernate 或其他一些框架(我从来没有对 Wicket Hibernate 或 Spring Integration 感到完全满意),那么情况会加倍.

Of them, the most comfortable for me to work with was Wicket, due to the lightweight nature of component building and simplicity of page templating. That goes doubly so if you are using your own db code instead of Hibernate or some other framework (I was never completely happy with Wicket Hibernate or Spring Integration).

Echo 非常棒.我知道现在不同了,但我仍然认为该产品服务于相当狭窄的利基市场.他们似乎也随着每个主要版本的发布而改变了开发模式.

Echo is great if you don't mind writing all of your layout in Java. I know that is different now, but I still think that product serves a fairly narrow niche. They change the development model with every major release as well it seems.

Tapestry 是一款很棒的产品,但在开发方面显然与其他产品有很大不同模型,因为它主要由一个家伙领导.Howard Lewis Ship 无疑非常聪明,但我对他们决定基本上忘记每个版本的向后兼容性感到失望.不过,同样,对于您的需求,这可能无关紧要,我一直觉得 Tapestry 产品使用起来很愉快.

Tapestry is a great product, but it is obviously very different from the others in terms of development model as it is led mainly by one dude. Howard Lewis Ship is no doubt quite smart, but I am disappointed with their decision to basically forget backwards compatibility with each release. Again, though, for your needs this may not matter, and I've always found the Tapestry products pleasurable to work against.

JSF 已经出来好多年了,还是感觉就像 Struts 人为解决 Struts 的所有问题而构建的东西.没有真正了解 Struts 的所有问题.它仍然有一种未完成的感觉,尽管该产品显然非常灵活.我使用它并喜欢它,对它的未来充满希望.我认为将在 JEE6 中交付的下一个版本 (2.0) 将真正将其纳入自己的版本,具有新的模板语法(类似于 Facelets)和简化的组件模型(自定义组件仅在 1 个文件中......最终).

JSF has been out for years, and still feels like something that a Struts guy built to fix all of the problems of Struts. Without really understanding all of the problems with Struts. It still has an unfinished feel to it, although the product is obviously very flexible. I use it and have some fondness for it, with great hopes for its future. I think the next release (2.0) to be delivered in JEE6 will really bring it into its own, with a new template syntax (similar to Facelets) and a simplified component model (custom components in only 1 file... finally).

当然,有一百万个较小的框架和工具得到了自己的关注(Velocity基本需求,原始 JSP、Struts 等).不过,我自己通常更喜欢面向组件的框架.

And, of course, there are a million smaller frameworks and tools that get their own following (Velocity for basic needs, raw JSPs, Struts, etc). I generally prefer component oriented frameworks myself, though.

最后,我建议您只看一下 Tapestry、Wicket 和 JSF,然后选择最适合您的那个.您可能会很快找到一款适合您喜欢的工作方式的产品.

In the end, I'd recommend just taking a look at Tapestry, Wicket, and JSF and just picking the one that feels the best to you. You'll probably find one that just fits the way you like to work very quickly.

这篇关于各种 Java Web 框架的优缺点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆