Code ít hơn thì tốt hơn

11:23 PM
Tất cả chúng ta đều nhận thấy rằng viết code quá nhiều có thể là một điều tệ hại, viết code ít hơn có nghĩa là ít sai sót hơn, nhanh tróng hoàn thiện phần mềm và đưa ra thị trường.

     Càng ngày càng nhiều các framework , sản phẩm mã nguồn mở được phát hành, cho phép bạn viết các ứng dụng với càng ít code hơn. Nhưng việc tái sử dụng quan trọng không chỉ vì nó mang nghĩa viết ít mã hơn mà còn bởi vì nó mang nghĩa tận dụng "trí khôn của đám đông". Các framework và các công cụ mã nguồn mở phổ biến — như là Hibernate, Spring, Strust — đang được sử dụng bởi vô số người trên toàn thế giới trong hàng loạt các ứng dụng khác nhau. Phần mềm được kiểm nghiệm và được tôi luyện trong thực tế này không phải là không có sai sót, nhưng bạn có thể an tâm giả định rằng bất cứ vấn đề nảy sinh nào sẽ được tìm thấy sẽ được sửa chữa một cách nhanh chóng và miễn phí.

Điển hình trong đó là apache commons, thư viện này rất tiện lợi, bạn sẽ thấy rằng thời gian và số lần gõ bàn phím mà bạn tiết kiệm rất nhiều.

Apache commons là gì?

Apache Commons là nơi tạo ra và phát triển các thành phần có thể tái sử dụng Java. Đó là nơi các lập trình viên làm việc cùng nhau và chia sẻ trong các dụ án của Apache.

Các lập trình viên luôn nỗ lực để các thư viện có sự phụ thuộc vào thư viện khác là ít nhất, để chúng có thể được triển khai dễ dàng. Các API luôn được giữ ổn định để bạn không phải lo lắng về các thay đổi trong tương lai.

Các project hiện tại của Apache commons.

Components
Attributes Runtime API to metadata attributes such as doclet tags.
BCEL Byte Code Engineering Library - analyze, create, and manipulate Java class files
BeanUtils Easy-to-use wrappers around the Java reflection and introspection APIs.
Betwixt Services for mapping JavaBeans to XML documents, and vice versa.
BSF Bean Scripting Framework - interface to scripting languages, including JSR-223
Chain Chain of Responsibility pattern implemention.
CLI Command Line arguments parser.
Codec General encoding/decoding algorithms (for example phonetic, base64, URL).
Collections Extends or augments the Java Collections Framework.
Compress Defines an API for working with tar, zip and bzip2 files.
Configuration Reading of configuration/preferences files in various formats.
CSV Component for reading and writing comma separated value files.
Daemon Alternative invocation mechanism for unix-daemon-like java code.
DBCP Database connection pooling services.
DbUtils JDBC helper library.
Digester XML-to-Java-object mapping utility.
Discovery Tools for locating resources by mapping service/reference names to resource names.
EL Interpreter for the Expression Language defined by the JSP 2.0 specification.
Email Library for sending e-mail from Java.
Exec API for dealing with external process execution and environment management in Java.
FileUpload File upload capability for your servlets and web applications.
Functor A functor is a function that can be manipulated as an object, or an object representing a single, generic function.
Imaging (previously called Sanselan) A pure-Java image library.
IO Collection of I/O utilities.
JCI Java Compiler Interface
JCS Java Caching System
Jelly XML based scripting and processing engine.
Jexl Expression language which extends the Expression Language of the JSTL.
JXPath Utilities for manipulating Java Beans using the XPath syntax.
Lang Provides extra functionality for classes in java.lang.
Launcher Cross platform Java application launcher.
Logging Wrapper around a variety of logging API implementations.
Math Lightweight, self-contained mathematics and statistics components.
Modeler Mechanisms to create Model MBeans compatible with JMX specification.
Net Collection of network utilities and protocol implementations.
OGNL An Object-Graph Navigation Language
Pool Generic object pooling component.
Primitives Smaller, faster and easier to work with types supporting Java primitive types.
Proxy Library for creating dynamic proxies.
Sanselan (now called Imaging) A pure-Java image library.
SCXML An implementation of the State Chart XML specification aimed at creating and maintaining a Java SCXML engine. It is capable of executing a state machine defined using a SCXML document, and abstracts out the environment interfaces.
Transaction Implementations for multi level locks, transactional collections and transactional file access.
Validator Framework to define validators and validation rules in an xml file.
VFS Virtual File System component for treating files, FTP, SMB, ZIP and such like as a single logical file system.

Trên đây là hơn 40 dự án hiện tại của apache commons. Hi vọng có ích cho bạn.

0 comments:

Post a Comment