One 、JAVA Core extension
JAVA Although the standard library provides the most basic data type operation methods , But there are still some common demand scenarios , Lack of utility classes . And others are JAVA The standard library itself is not perfect , What needs to be supplemented by a third party Library .
1、Apache Commons Lang
Apache Commons Lang yes Apache The most famous JAVA library (GitHub Code base on ), It's right java.lang It's good to expand , Contains a large number of very practical tool classes , Most of them are StringUtils,DateUtils,NumberUtils etc. .
except Apache Commons Lang, There are others Apache Ku is also right JAVA It's a good addition to itself , Such as Apache Commons Collection,Apache Commons IO,Apache Commons Math
Google Cuava Contains Google In their own JAVA Some of the cores used in the project JAVA library . Contains the right ： aggregate , cache , Concurrent Libraries , string manipulation , I/O And so on . in addition Google Libraries developed are always known for their performance .
Java SE 8 Previous JAVA The support for dates in this version is poor ,Joda-Time Is often used to replace the original date system , It can support more calendar systems , And provides a lot of very convenient date processing methods , And its performance is excellent .(GitHub Code base on )
Two 、Web frame
Web Framework is the core part of an application , So I always recommend the most standard , And there's a good community support framework , such as Spring and Struts.
Spring Is an open source application framework , It contains many subprojects, such as Spring MVC, Spring Security, Spring Data,Sping Boot wait , Almost everything you need on your project . It's also my development Web The preferred back-end framework for the project .(GitHub Code base on )
Struts 2 yes Apache The most famous Web frame , It's also a free and open source MVC frame .Struts Can also support REST,SOAP,AJAX Wait for the latest technology .(GitHub Code base on )
Except for the two longest ones mentioned above, your Web Outside the framework , What's more Google Web Toolkit, Tapestry, Strips And other excellent frameworks to choose from .
3、 ... and 、 database ( Persistence layer )
The choice of persistence layer framework is also critical to the success or failure of a project , It will directly affect the performance of the system 、 quality 、 Safety and stability .
MyBatis It's my favorite database ( Persistence layer ) frame , Because it's all based on SQL Of the statement ( adopt SQL To extract data and automatically map it to the desired data object ), Can give me enough flexibility .(GitHub Code base on )
2、Spring JDBC / Spring Data
Spring JDBC It's not independent Spring subprojects , It's an integration of Spring In the core library , by JDBC Operation provides the basic encapsulation processing module . After a simple configuration , It can be done by Context Medium jdbcTemplate Make a call to get the result .
Spring Data yes Spring A subproject of , Provides a more powerful encapsulation of persistence layer functions , And object mapping . It can be associated with Spring MVC Well integrated . You can use JPA and CrudRepository To greatly simplify the development of persistence layer .
Hibernate It is probably the most widely used persistence layer framework in China , It's very powerful , But it's not easy to make good use of it , You need to understand its internal mechanisms , Otherwise, there may be some unforeseen performance problems , Especially when the amount of data is very large .(GitHub Code base on )
In addition to some of the most commonly used persistence layer libraries above , There are also several excellent Libraries , such as JDO,JOOQ,Apache DbUtils etc.
Four 、 journal
JAVA Logging is also included in , But it's dealing with log grading , Storage of logs , And log backup 、 They're not good enough at archiving , Therefore, in the project, we usually use a third-party log library to process logs .
1、SLF4J- Simple Logging Facade for Java (SLF4J)
SLF4J Provides us with an abstraction layer for logging services , Based on it , You can choose different log implementations , such as ：java.util.logging,logback,log4j, When you need to change the log implementation component , You don't need to change any code , Just change the configuration .(GitHub Code base on )
Log4j Is the most famous logging component , After simple configuration, you can easily record all levels of logs in the program , Its log files can be named and archived according to different rules .
Logback Than Log4j to update , It's seen as log4j A substitute for . It is better than log4j Better performance , And more fully realized SLF4J The interface of , And it comes with more functions , For example, automatic log compression , added filter etc. .
JSON It has become the most widely used data transmission format , So in the program JSON And it's getting more and more .
Here's the power node java Some of those recommended by training institutions JSON Processing library ：
Jackson It's a multi-purpose Java library , Used for processing JSON data . It's easy to use in JSON Data and Java Convert between objects .(GitHub Code base on )
Google Developed JSON library , Can achieve JSON String and JAVA Conversion between objects , It's also very convenient to use .
5、 ... and 、 Chart
Can generate all kinds of charts for you , And support a variety of output formats , Include PNG and JPEG Image format , As well as to PDF,EPS,SVG Isovector diagram .
JasperReports Provides a complete set of report solutions , Help users use Java Language to develop programs with reporting capabilities .JasperReports The template of XML Format , Extract... From the database data , And PDF、HTML、XLS、CSV And XML And so on . One of its advantages is that it can handle reports with a large amount of data .
6、 ... and 、 test
JUnit Is currently the most widely used JAVA Unit test library through it , You can i It's very convenient to write your own unit test code , And automated testing .(GitHub Code base on )
7、 ... and 、Office Document processing
Apache POI Is a free open source library for dealing with Microsoft Office file . You can use it Java Read and create , modify MS Excel file ,MS Word and MSPowerPoint file .(GitHub Code base on )
docx4j It's another set based on JAXB Of Office file (docx,pptx,xlsx) Processing library .(GitHub Code base on )
8、 ... and 、XML analysis
JDOM It's an open source project , It's based on a tree structure , Pure utilization JAVA The technology is right XML Document implementation parsing 、 Generate 、 Serialization and multiple operations . stay JDOM in ,XML Element use Element Express ,XML Properties with Attribute Express ,XML The document itself uses Document Express . So these API It's very intuitive and easy to use .(GitHub Code base on )
DOM4J It's a process XML Open source framework of , It's a combination of XPath, And fully support DOM,SAX,JAXP Technology .
Xerces Is an open source XML parsers . from JDK1.5 in the future ,Xerces became JDK Of XML Default implementation
Nine 、 Other noteworthy code bases
jSOUP Provides a set of web pages with external Internet (HTML) interactive API, It's very convenient for users to utilize CSS Selectors to parse HTML page , To get what you need .
Lombok It's a kind of Java Utilities , Can be used to help developers eliminate Java Long , Especially for simple Java object (POJO). It does this through annotations . By means of IDE Add Lombok, Developers can save on building things like hashCode() and equals() This method and the past used to classify all kinds of accessor and mutator A lot of time .
Netty By JBOSS One of the java Open source framework .Netty Provide asynchronous 、 Event driven network application framework and tools , For rapid development of high performance 、 High reliability network server and client End program . in other words ,Netty It's based on NIO The customer , Server side programming framework , Use Netty Can ensure that you quickly and easily develop a network application , For example, customers who have implemented some kind of agreement , Server applications .
That's the power node java Training institutions Xiaobian introduced “Java Third party libraries are commonly used ” The content of , Hopefully that helped , more java The latest information, please continue to pay attention to the power node java Official website of training institution , There will be wonderful content to share with you every day .