Thursday, July 26, 2007

grubby - a quick and dirty data generation tool

Over the past few weeks I've been open sourcing code from the last few projects I've worked on. It's firstly a set of classes providing random generation utilities plus some handy utility methods. These are available in a 0.1 release from the project website and you can use them now.

Building upon this, next I'll be working on a set of "data beans". The idea is that these will be simple POJO representations of a row in a database or a CSV file, capable of toString'ing themselves to CSV or a SQL insert statement and stored in collections which are self iterating (think ruby). If this sounds like your common or garden data model beans with a little extra functionality, you'd be right. Ideally, this component can leverage a from-schema generation tools based upon EJB 3.0/JPA 1.0 (such as Netbeans) so you don't have to write these yourself. These can be edited so they extend the grubby data beans abstract classes which provides the extra grubby functionality. To use, all you need to do is generate your beans, fill them with random data using the aforementioned generation utilities and then get them to toString themselves to the data upload file type of your choice - SQL or CSV.

Beyond this I plan to create a set of annotations to use so you can simplify the definition of the allowed values for an attribute and also specify the relationships between beans with ease. In addition, there will be a config engine so users can specify where input and output files are located and a set of common builders to reduce the need to implement some common elements entirely (e.g. Addresses).

So, if it sounds like this is something you might find useful, please go to the site and take a look. If you want the javadoc and other information, checkout the project source and generate the maven site (run the "maven site" goal). If you want to help, check out the code and have a look. If you have some comments, suggested changes or a patch, send me a mail. Enjoy.

No comments: