APACHE COMMONS

陶永望
2023-12-01
the commons project already has more than three dozen components; some have been developed from scratch, and other have been pulled out of bigger projects under jarkata.
the components that are part of jakarta commons are categorized into two parts:
commons proper: this section holds components that are in a production-ready state. experimentation and changes will be minimal and systematic with these components.
sandbox: the sandbox components are those that hold a lot of promise but still in an incomplete stage. many of the sandbox components are still on the dramming border or in beta and alpha releases.

the following are the various components currently featured in the commons proper:
beanutils:javabeans adhereing to standard naming conventions as specified in the javabean specification and having private member variables with a public get method to fetch the value of the variable and a set method to set it are often used in java development.
betwixt: the betwixt component provides a way to easily convet javabeans into xml.
cli: this component makes working with command line arguments simple and systematic. it provides a methodology to specify arguments,their usahe and access to arguments.
codec:codec provides implementations for common encoders and decoders.
collections:the collections components go beyond what is offered by the java collection framework and provides many classes that offer useful collections and utilities.
dbcp:the database connection pool component provides the functionality of pooling database connection and optimally utilizing them. database connections are precious resources that need to be created and used wisely.
dbutils: the dbutils component is a handy set of classes capable of easily handling most of the routine tasks aht need to be performed while accessing a database using java database connectivity.
digester: creating ,parsing and using xml files can be quite a pain if only the basic apis are used. digester makes working with xml quite simple and is of great use, especially while retrieving information from configuration files.
discovery:the discovery component is meant to ease discovery of implementation for various interfaces.
el:an important addition to java server pafge is the support for an expression language. the el component is an expression lanuage interpreter.
fileupload:the fileupload component can provide file upload capability to web applications.
httpclient: the httpclient component goes beyond hypertext transfer protocol features offered by the net component and provided many features required by a java client communicationg using http.
jelly:jelly is a component that can convert xml into executable code. jelly has many subelements that use the core concepty to achieve different ends.
jexl:jexl stands for jave expression language. the jexl component provides an expression lanuage engine that implements an extended version of the expression lanuage of jsp standard tag libraries.
jxpath:jxpath is an interpreter for xml.
org.apache.commons.lang: this package provides the classes you are likely to use most often while working with the lang component. the builder package consists of classes that help in creating commonly used metheds.

the validator component is a framework you can use to take the drudgery out of writing validation code. the validator component comes with a built-in validation capability for some common validations. the validator component began as part of the struts framework.

the advantages of using the validator framework are as follows:
validaton rules can be defined in xml files.
validation rules can be changed without having to touch the source code.
built-in validations handle most of the common scenarios.

pooling is an important concept and if used wisely can reduce resource consumprion as well as boosts your application's performance. the pool component consists of two package :org.apchae.commons.pool and and org.apche.commomns.poll.impl. the package org.apche.commons.pool provides interface and base implementations and the org.apache.commons.pool.impl package provides implementations of a few types of object pooling that are possible.
the objectpool inerface is what defines the methods that each pooling implementation has to provide. the interface is simple enough, the methods borrowobject and returnobject are the two you will use the most.
the dbutils component is a nice ,simple component that does nothing but jsut makes many jdbc tasks a shade easier for the developer. although many persistence frameworks and packages are aviable these days that aim at making data persistence a littler eaiser,jdbc still is very much the bread and butter for most java and java2 enterprise edition developers.
 类似资料:

相关阅读

相关文章

相关问答