JAKARTA Project's Commons Tools

xiaoxiao2021-04-05  285

There are many subpredals in Jakarta Project in Apache. The Commons focuses on providing a variety of very common functions / classes.

Everyone can use it in our own project. These Tools are very common, so that no matter which framework you use, you

You can use some of them to save your own encoding amount, and its code quality is also very good.

Part of the Commons Tools is part of the starting point to solve the various deficiencies in JDK:

1. Exception is not easy to use, have to write a lot of try catch, and changed to the use of C / C to determine the return value, you can write a lot less

code. This is the most tone of JDBC Interface.

2. Make up the imperfect place of the JDK class library. For example, String, Collection Framework, regular expressions, etc.

I intend to write articles to introduce several of which I think is more common:

CODEC contains the encoding and counterpodes of HEX, Base64, URL. It is useful for web applications.

Commons-Collections Enhances the JDK's Collection Framework feature.

Commons-Configuration Read and write configuration parameters. Most programs have run parameters to place a place, this tool can read and write various parameters format: database, XML, Properties file, system variable, and more. Is it strong?

Commons-dbcp database connection pool, huh, now there are many servers that connect pools. But there are also a lot of direct use. If you write a java application to use the database, use this.

DBUTILS can reduce the TRY CATCH of the JDBC program to reduce the amount of code. I want to write something written without time. But there is no imagination.

Email emails. The JDK standard library is not strong for power generation, which is very unknown.

FileUpload file upload. The J2EE Standard Library is not strong for file uploading, but also can't understand. These two features are basic features for the current J2EE app. A little bigger system will have.

IO although the JDK name IO rewritten, and also used the Package name of NIO (New IO), but still not good enough. This can be seen as an enhanced version.

Commons-lang good things. The lang package is the most basic package of Java, the default automatic import, the function is still not strong enough, supplement! This package is in other systems, including WebLogic, WebSphere. Basically, all the Java systems that have a bit of famous use will use it.

Commons-logging Good. Most EJB Server and Tomcat are used. Open source Java Project is mostly used. Abstract layer of log. There are many kinds of logs in Java, and if you choose a development program, you will try another one, more troublesome. Through this tool abstraction, it is easy to change. However, recent Log4j is a large, JDK comes with a few people, and there seems to be no other log, and people don't understand.

Math huh. The MATH package in Java can only be barely enough. If you have a little bit of mathematical functions, you must write it yourself. Use it, save time.

NET enhances Java network function. Java's network class library is different from a professional C network class library, the difference is still very big. It is still good here.

Commons-pool common object pool. Not an EJB object pool. This thing is very difficult to write. It is not good to make the special consumption, and the speed is slow (such as EJB). In any case, it is a good idea to learn from. Validator This is a good thing. Whether it is a WEB application or a normal Java application, as long as the user input interface is used. Compared to yourself. Not approved in XML, more letters, less alphabet, one letter.

COMMONS Project also has Sandbox, including Cache, Clazz, Compress, Convert, I18n, ID, Mapper, SQL, ThreadPool, etc., many are used. Hey, good things, how do you introduce it?

Slowly, an article is slow. I hope everyone will support it.

转载请注明原文地址:https://www.9cbs.com/read-132064.html

New Post(0)