Java框架选择问题 [英] Java Framework Choice Question

查看:108
本文介绍了Java框架选择问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们确实有许多Java可用的框架。 Struts,Swing,JSF 2.0,Spring等按优先级使用。实际上,我不知道它们有多少!

We do have many frameworks available in Java. Struts, Swing, JSF 2.0, Spring etc are used as per their priority. Actually, I don't know how many they are as well!

但是,由于我对Java更新,甚至学习它们的架构,我无法确定哪个框架可以与什么类型的项目一起使用!

But, as I am fresher to Java, even learning after their architecture, I cannot decide which framework can be used with what type of Projects !

另外,我对Spring + JSF这样的框架的混合使用感到困惑。它有什么好处?

Also, I am confused with mixed use of framework like Spring + JSF. What is the benefit to it ?

让我感到困惑的另一件事是关于市场上可用的UI组件。就像,我们有Primefaces,Ice-faces,MyFaces,Rich-faces。它们可能支持也可能不支持内置的AJAX。它们也可能包含一些错误。什么是Framework + UI组件的最佳选择,可以直接为任何项目提供最佳的解决方案?

Another thing making me confusing is about the UI components available in market. Like, we do have Primefaces, Ice-faces, MyFaces, Rich-faces. They may or may not have been supporting AJAX in-built. They may contains some bugs as well. What is best choice for Framework + UI component that can directly provide a best feet solution for any project ?

推荐答案


我们确实有许多Java可用的框架。 Struts,Swing,JSF 2.0,Spring等按优先级使用。实际上,我不知道它们有多少!

We do have many frameworks available in Java. Struts, Swing, JSF 2.0, Spring etc are used as per their priority. Actually, I don't know how many they are as well!

Swing 不是基于Web的框架。这是一个桌面UI框架。你可能会对Spring MVC感到困惑。

Swing is not a webbased framework. It's a desktop UI framework. You're probably confusing with Spring MVC.

所有这些框架都可分为两种:

All of those frameworks are dividable in two kinds:


  1. 基于请求的MVC框架(Struts,Spring MVC)。

  2. 基于组件的MVC框架(JSF,Wicket)。

基于组件的MVC框架被视为基于请求的MVC框架的进一步发展。如果您想要更多抽象(即基本上最终得到视图和模型),请选择基于组件的MVC框架。如果您想要更多地控制控制器部件,请选择基于请求的MVC框架。

A component based MVC framework is seen as a further evolution of request based MVC framework. Choose a component based MVC framework if you want more abstraction (i.e. you basically end up with a view and a model). Choose a request based MVC framework if you want more control over the controller part.

另请参阅

  • Struts2 or JSF
  • Component based vs Request based Java frameworks
  • Choosing a Java web framework now

但是,因为我对Java更新鲜,甚至在他们的架构之后学习,我无法确定哪个框架可以用于什么类型的项目!

But, as I am fresher to Java, even learning after their architecture, I cannot decide which framework can be used with what type of Projects !

作为个人意见,转到JSF 2.0。

As a personal opinion, go for JSF 2.0.

另见

  • Sun JSF 2.0 tutorial
  • Coreservlets JSF 2.0 tutorial
  • Simple JSF 2.0 CRUD example

另外,我对Spring + JSF等框架的混合使用感到困惑。它有什么好处?

Also, I am confused with mixed use of framework like Spring + JSF. What is the benefit to it ?

Spring更像是一个注入(控制反转)框架。有人可能会说,它是EJB的替代品。 Spring MVC 是一个基于请求的框架。

Spring is more an injection (inversion of control) framework. One may say, it's the alternative to EJB. Spring MVC is a request based framework.

参见:

  • Wikipedia: Inversion of Control
  • Spring vs others

让我感到困惑的另一件事是关于市场上可用的UI组件。就像,我们有Primefaces,Ice-faces,MyFaces,Rich-faces。它们可能支持也可能不支持内置的AJAX。它们也可能包含一些错误。什么是Framework + UI组件的最佳选择,可以直接为任何项目提供最佳的解决方案?

Another thing making me confusing is about the UI components available in market. Like, we do have Primefaces, Ice-faces, MyFaces, Rich-faces. They may or may not have been supporting AJAX in-built. They may contains some bugs as well. What is best choice for Framework + UI component that can directly provide a best feet solution for any project ?

MyFaces是另一个JSF 实现,对于残余,你只提到JSF组件库。这些是用于在JSF实现的顶部。选择哪一个取决于哪一个最适合您的功能要求(肤色,可吸收性,增强性等)。

MyFaces is another JSF implementation and for the remnant you only mention JSF component libraries. Those are meant to be used on top of a JSF implementation. Which one to choose depends on which one suits your functional requirements the best (skinnability, ajaxability, enhancability, etc).

作为个人意见, PrimeFaces 2.0 看起来最好。

As a personal opinion, PrimeFaces 2.0 looks the best.

参见:

  • What's the difference between JSF implementations and component libraries
  • What's the difference between JSP/Servlet/JSF

这篇关于Java框架选择问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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