适用于Java Web开发者的十大必要的框架和库

原文链接:https://www.java67.com/2018/02/top-10-open-source-frameworks-and-libraries-java-web-developers.html


Java programming language and platform has been fortunate in terms of frameworks, standards, and libraries, I guess which is one of the important reason for its huge success.

就框架、标准和库方面而言,Java编程语言和平台一直很幸运,我猜测这也是它获得巨大成功的最重要的原因之一。

Apart from standard frameworks like Swing for desktop GUI application, JavaFX, Servlets and JSP, EJB, and JSF, there are a lot more open-source frameworks and libraries available for Java programmers.

除了像用于桌面GUI应用程序的Swing、JavaFX、Servlets 、JSP、EJB 和 JSF 标准框架,对Java程序员还有更多可用的的开源框架和库。

These Open source framework, not only helps and speed up development but also enforce to use best practices required to build enterprise Java application and desktop application.

这些开源框架不仅仅帮助和加速开发,而且强制使用构建企业Java应用程序和桌面应用程序所需要的最佳做法。

Frameworks like Spring, which, in my opinion, gives a much-needed boost to the Java platform, enforces the Dependency Injection design principle at the core, which is crucial to building a loosely coupled system.

在我看来,像Spring框架,极大的促进了Java平台的发展,强制执行依赖注入设计核心原则对于构建一个松散耦合系统至关重要。

Similarly, Struts and Spring MVC have made web development a lot easier, rather than just using Servlet and JSP.

相似地,Struts 和 Spring MVC 使得web开发变得容易得多,而不是仅仅使用 Servlet 和JSP。

Java Programmer, both beginners and experienced, must know about these frameworks, they not only help them in their work but also to get a Job as more and more companies are adopting framework based development.

无论是初学者还是有经验的Java程序员,必须知道这些框架,它们不仅在工作中帮助Java程序员而且在他们找工作的时候,越来越多的公司采用基于框架的开发。

I have seen so many resumes that are not considered for interviews because there is no mention of Spring, Struts, or Maven.

我看过很多简历没有被考虑面试,原因在于他们没有提及Spring,、Struts、或Maven。

Though I don’t agree with this practice because if you are good at programming, OOP design, and Java, you can quickly learn those, it does happen in the real world, and there is no harm in mentioning these frameworks in your Resume if you have learned them.

虽然我不是很同意这种做法,因为如果说你擅长编程,OPP设计和Java,你就可很快的学习这些,这种情况确实存在,如果你已经学会了这些,在你的简历里提及这些框架是没有危害的。

In this article, I will share the top 10 Java Frameworks for web developers, which include core Java framework, unit testing framework, Java web development framework, and, of course, build frameworks.

在这篇文章,我将会分享适用于web开发者的十大Java框架,包括核心Java框架、单元测试框架、Java web 开发框架,当然,还有构建框架。

It’s a good idea to at least know about these open-source Java libraries and frameworks so that you can learn them in detail when the need comes.

至少了解这些开源Java库和框架是一个好主意,以便在需要时你可以详细学习他们。

Here is my list of some of the necessary frameworks and libraries for Java web developers. The list includes web development frameworks like Spring MVC, Struts, Seam, Primefaces Google Web Toolkit, and ORM tools like Hibernate, testing libraries like JUnit and Mockito along with Eclipse RCP platform for creating desktop GUI in Java.

这是我为Java Web开发人员准备的一些必要框架和库的列表。该列表包括Web开发框架,例如Spring MVC、Struts、 Seam、 Primefaces Google Web 工具包,还有ORM工具如Hibernate,测试库如JUnit 和Mockito 之类的库以及用于在Java中创建桌面GUI的Eclipse RCP平台。


1) Spring MVC

No doubt that Spring MVC is the best Java web development framework to date. In many ways, Spring made Java development more comfortable, streamlined and gives it much needed a boost.

毫无疑问Spring MVC 是迄今为止最好的Java Web开发框架。在许多方面,Spring使Java开发更加舒适、效率更高并且使其急需增强。

Spring, on its core, provides an IOC container, which takes responsibility for managing System objects and wiring them together, but that’s just one of the Spring functionality.Spring has a suite of libraries, which is crucial for enterprise Java development.

就其核心而言,Spring提供了一个负责管理系统对象并把它们连在一起的IOC容器,但是那只是Spring功能之一。Spring有一套对于企业Java开发至关重要的库。

Spring provides Spring Security, which a top-class Security framework, provides an easy way to implement LDAP authentication, Open ID authentication, Control on concurrent active sessions, and several other useful features Out of the box.

Spring提供了Spring Security,这是一个顶级安全框架,提供了一个简单的方法来实现LDAP身份验证、Open ID身份验证、对并发活动的控制以及其他一些有用的功能。

Spring MVC is another pillar of the Spring framework, which provides an implementation of the Model View Controller design pattern, and also enforces several other Web-related best practices, like View Resolver.

Spring MVC是Spring框架的另外一个支柱,它提供了Model View Controller设计模式的实现,并且还实施了其他一些与Web相关的最佳方案,例如View Resolver。

The latest release of Spring 5 has also added support for Kotlin, the official language for Android development and some reactive programming features, which is very useful for developing modern web applications. Apart from these, there are a lot more Spring offers you, check Spring Masterclass to learn more about Spring.

Spring 5的最新版本还增加了对Kotlin的支持,Kotlin是Android开发的官方语言,并且具有一些响应式编程功能的特点,这对开发现代Web应用程序非常有用。除此之外,Spring提供了更多的信息,请查看Spring Masterclass以了解有关Spring的更多信息。

2) Struts 2.x

Before Spring, Struts was king of the Java web development framework. In his days, it was the best Java MVC framework and to date used in large companies. Web applications written during early 2000 are mostly written on Struts.

在Spring之前,Struts是Java Web开发框架的王者。在他的时代,它是迄今为止最好的Java MVC框架,并已在大型公司中使用。2000年初编写的Web应用程序大部分是用Struts编写的。

Anyway, Struts has come a long way then. Struts 1.0 has gone, and today’s Struts is mostly Struts 2.0, see the difference between Struts 1 and 2. Despite the immense popularity of Spring MVC, Struts 2 still holds it’s placed.

无论如何,Struts已经走了很长一段路。Struts 1.0已经不存在了,今天的Struts主要是Struts 2.0,请看Struts 1和2之间的区别。尽管Spring MVC的普及程度很高,但Struts 2仍然占有一席之地。

It’s good to develop simple web 2.0 applications. I believe legacy code with Struts 1.0 and the existing pool of Struts developers will keep this framework alive.

最好开发简单的Web 2.0应用程序。 我相信Struts 1.0的遗留代码和现有的Struts开发人员池将使该框架保持活力。

3) JUnit

JUnit is the best Unit testing framework for the Java application. Having JUnit on your resume makes a positive impression.

JUnit是Java应用程序的最佳单元测试框架。 在简历上写使用过JUnit会给人留下积极的印象。

Though JUnit is there for a long time and almost become part of Java application development, it took a big leap with JUnit 4.0, which uses annotation to write unit tests even more easier.

尽管JUnit已经存在了很长时间,并且几乎成为Java应用程序开发的一部分,但它在JUnit 4.0上取得了长足的进步,JUnit 4.0使用注释使编写单元测试更加容易。

JUnit 4.0 annotations added a lot of convenience and power to unit test, It makes it easy to write a unit test for checking Exceptions. Though TestNG is another useful Java testing framework, JUnit has its own place.

JUnit 4.0批注为单元测试增加了许多便利和功能,它使编写用于检查异常的单元测试变得容易。 尽管TestNG是另一个有用的Java测试框架,但JUnit拥有自己的位置。

The latest version of JUnit, JUnit 5.0, also has some useful features which make your test more readable and robust. If you are serious about learning the unit testing skill to improve your career prospects, I suggest to start now, and JUnit and Mockito Crash Course is the right place, to begin with.

最新版本的JUnit JUnit 5.0还具有一些有用的功能,这些功能使您的测试更具可读性和鲁棒性。 如果您认真地学习单元测试技能以改善您的职业前景,我建议立即开始学习,JUnit和Mockito Crash Course是适合的起点。

4) Maven

I am not sure if you agree to mention Maven as a framework, but to me, it looks like a build framework. Before Maven, ANT was prevalent, and almost all companies have their own build framework based on ANT. Now, Maven rules.

我不确定你是否同意将Maven作为框架,但是对我来说,它看起来像一个构构建框架。在Maven之前,ANT很流行,几乎所有公司都有基于ANT的自己的构建框架。现在,Maven统治了。

The biggest strength of Maven is convention over configuration; with ANT, you need to define everything, like source directory, target directory, etc. Maven enforces a standard project structure and uses reasonable default values to simplify the build procedure.

Maven的最大优势是约定胜于配置。 使用ANT,您需要定义所有内容,例如源目录,目标目录等。Maven强制执行标准项目结构,并使用合理的默认值来简化构建过程。

Another thing, which makes Maven a great Java framework is a concept of maven repository and dependency management, It’s super easy to include new dependency with Maven than managing a whole lot of JAR files.

使Maven成为出色的Java框架的另一方面是Maven存储库和依赖项管理的概念,与管理大量JAR文件相比,将新的依赖项包含在Maven中非常容易。

If you don’t know Maven, start learning it now. Use Eclipse IDE and M2Eclipse maven plug-in. It’s worth learning. The Maven Quick Start is an excellent point to begin your journey.

如果您不了解Maven,请立即开始学习。 使用Eclipse IDE和M2Eclipse Maven插件。它值得学习。 Maven快速入门是开始您的旅程的绝佳选择。

5) Hibernate

Spring and Hibernate were one of the most desired skills set a couple of years back. Though EJB 3.0 spoiled the party a bit, Hibernate is still a great Java persistence framework and worth learning. Projects either use JEE or Spring for development, and Hibernate fits well with Spring.

Spring和Hibernate是几年前最需要的技能拍档之一。 尽管EJB 3.0稍微破坏了聚会,但是Hibernate仍然是一个很棒的Java持久性框架,值得学习。 项目使用JEE或Spring进行开发,而Hibernate非常适合Spring。

Also, it’s one of the pioneers in the Object Relational framework, known as the ORM framework. Now there is a couple of alternatives available, like TopLink, but Hibernate is still the market leader.

此外,它还是对象关系框架(称为ORM框架)的先驱之一。 现在有几种替代方法可供选择,例如TopLink,但是Hibernate仍然是市场领导者。

Hibernate is also good skill in CV, and you are likely to see a couple of questions from Hibernate, like the difference between getting and load or save vs. update vs. persist during Java interviews for web development. If you want to learn more about essential Hibernate feature, then Hibernate, and JPA Fundamentals is an excellent place to start with.

Hibernate在CV方面也很熟练,您可能会从Hibernate中看到几个问题,例如在Web开发的Java采访中获取和加载或保存与更新与持久化之间的区别。 如果您想了解有关基本的Hibernate功能的更多信息,那么Hibernate和JPA基础知识就是一个很好的起点。

6) PrimeFaces

PrimeFaces is a Java Framework that provides the JSF component to develop a rich web application. PrimeFaces delivers a rich set of components for Java Server Faces 2.0, like HtmlEditor, AutoComplete, Dialog, etc.

PrimeFaces是一个Java框架,它提供JSF组件来开发丰富的Web应用程序。 PrimeFaces为Java Server Faces 2.0提供了一组丰富的组件,例如HtmlEditor,AutoComplete,Dialog等。

It also has built-in support for Ajax-based upon JSF 2.0 Ajax APIs. PrimeFaces is lightweight and easy to use. It also has excellent community support, which is key to the success of any open-source framework.

它还基于JSF 2.0 Ajax API内置了对基于Ajax的支持。 PrimeFaces轻巧且易于使用。 它还具有出色的社区支持,这对于任何开源框架的成功都是至关重要的。

7) Seam

Seam is a Java web framework from JBoss. There are a lot of good reasons mentioned in Why Seam’s page of Seam Framework. Some of them include its Ajax support, the easiest way to use EJB 3.0, and the best way to leverage JSF.

Seam是JBoss的Java Web框架。 在Seam的Seam框架页面中提到了很多充分的理由。 其中一些功能包括对Ajax的支持,使用EJB 3.0的最简单方法以及利用JSF的最佳方法。

Though I haven’t used Seam yet in any professional projects, It seems a useful web framework, which demands evaluation.

尽管我尚未在任何专业项目中使用Seam,但它似乎是一个有用的Web框架,需要评估。

8) Google Web Toolkit (GWT)

GWT or Google Web Toolkit is one of the best Java Web Frameworks from Google. GWT allows you to build a rich Java web application by providing powerful user interface capabilities.

GWT或Google Web Toolkit是Google最好的Java Web Framework之一。 GWT允许您通过提供强大的用户界面功能来构建丰富的Java Web应用程序。

There are lots of plugins, tools, examples available from Google, which can help you to learn GWT quickly.

Google提供了许多插件,工具和示例,可以帮助您快速学习GWT。

Though the learning curve is a bit more if you are coming from Spring or Struts background. GWT can be used to developer browser-independent AJAX-based applications.

虽然如果您来自Spring或Struts,则学习曲线会更多一些。 GWT可用于开发独立于浏览器的基于AJAX的应用程序。

9) Mockito

Mockito is a Java testing framework for creating mock objects. Though there are a couple more mock objects frameworks like JMock and EasyMock, Mockito is one of the best and easy to learn. Mockito has clean and straightforward syntax but, at the same time, rich enough to support that.

Mockito是用于创建模拟对象的Java测试框架。 尽管还有更多的模拟对象框架,例如JMock和EasyMock,但是Mockito是最好的和易于学习的框架之一。 Mockito具有简洁明了的语法,但同时又足够丰富以支持该语法。

One of the drawbacks of Mockito is that it doesn’t support mocking of static methods, but you can use combine Mockito with JMockit to do that.

Mockito的缺点之一是它不支持静态方法的模拟,但是您可以将Mockito与JMockit结合使用。

Apart from JUnit for unit testing, learning one of the mock object frameworks gives a new edge to your unit testing capability, and if you are looking for an excellent resource to get going, then is Mockito Tutorial: Learn mocking with 25 Junit Examples a great place, to begin with.

除了用于单元测试的JUnit之外,学习一种模拟对象框架还可以为您的单元测试功能带来新的优势,如果您正在寻找一种出色的资源来学习,那么Mockito教程:通过25个Junit示例学习模拟非常有用 的地方,开始。

10) Eclipse RCP platform

Eclipse RCP is one of the best Java frameworks for developing a rich desktop application. By the way, when it comes to building desktop applications in Java, Swing rules, but Eclipse RCP is no way behind. It’s free, has excellent tutorials and proper documentation.

Eclipse RCP是用于开发丰富的桌面应用程序的最佳Java框架之一。 顺便说一句,当涉及到用Java构建桌面应用程序时,Swing会遵守规则,但是Eclipse RCP绝不落后。 它是免费的,具有出色的教程和适当的文档。

That’s all on this list of Top 10 Java frameworks and Libraries guys. Java is rich, very rich, and there are a lot of open source web frameworks available in Java, It’s often a good idea to do some Googling before choosing any web framework for development. Apart from mentioned above, let us know which Java framework you have been using, which are your favorites ones.

这就是十大Java框架和库专家的名单。 Java是丰富的,是非常丰富的,并且有许多可用的Java开放源Web框架。在选择任何Web框架进行开发之前,最好先进行一次Google搜索。 除了上面提到的,让我们知道您一直在使用哪个Java框架,哪个是您最喜欢的Java框架。

Thanks for reading this article so far. If you find these open-source Java web development libraries useful, then please share it with your friends and colleagues. If you have any questions or feedback, then please drop a note.

感谢您到目前为止阅读本文。 如果您发现这些开源Java Web开发库很有用,请与您的朋友和同事共享。 如果您有任何疑问或反馈,请留下笔记。

发布了71 篇原创文章 · 获赞 102 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qq_44717317/article/details/104203494