Monday, August 29, 2011

Analysis of Java OpenCSV csv parser


OpenCSV Java csv parser and generator


According to Prof Philip Johnson of the Univ of Hawaii at Manoa, there are three prime directives for open source software engineering:
The three Prime Directives for Open Source Software Engineering are:
1. The system successfully accomplishes a useful task.
2. An external user can successfully install and use the system.
3. An external developer can successfully understand and enhance the system.

In this entry I'll analyze the Java OpenCsv csv parser at http://sourceforge.net/projects/opencsv/ according to these three metrics and see where is stands.

This package satisfies the 1st prime directive (accomplishes at least one useful function) with flying colors and even goes beyond the advertised description by providing csv parsing and output, complete with configurable delimiter and quote character selection.

It satisfies the 2nd prime directive (easy user installation and use), if only because the configuration is very simple. The unzipped contents of the downloaded package do not contain a readme.txt file, but they do include a one-page tutorial in the doc directory. The code is also javadoc compliant and includes javadoc documentation(automatically generated from the comments). However, to get the included example apps to work, I had to infer from a path-not-found exception that the examples should be left in the examples directory to be found, as the path to their inputs is hard-coded in the examples code. Instead of running the code via command line from the unzipped directory, I had copied the deployment jar file (in the deploy directory) and the examples (in the examples directory) to an Eclipse project I created to test the app. This disturbed the directory layout the example code was designed to work with. If there were a README.txt file specifying that, I probably wouldn't have made that mistake.

The 3rd prime directive (easy understanding of internals and extensibility), is also clearly satisfied so much so that two added features not written by the original package author, are included in the package. They are JavaBean to csv conversion, and relational database table to csv conversion. The 3rd directive is also satisfied because the package includes maven build files and a directory layout that reflects an automated build and deployment process, and extensive unit and integration testing code(in the test directory).



No comments:

Post a Comment