This week on InformIT.com I start a new series that demonstrates how to integrate Hypersonic DB into your client applications.
Where this started was that I have been using an online project management application called Nozbe as an implementation of David Allen’s Getting Things Done. I have my personal projects and tasks there, but I wanted to add my business projects. Unfortunately I am currently working on a project under several NDAs, so I do not feel comfortable storing information about this project in Nozbe’s cloud. My idea, therefore, was to build a portable client application that lives on my external hard drive (so that it can run at work, at home, or where ever) that does the same thing. The challenge I faced was that as the number of projects grows, the performance will degrade and the required memory will increase if I add all of the features that I want. As soon as I designed XML documents to host each project and then built indexes to be able to search them I realized that I needed a database. But in order to stay portable I do not want to install a database.
The answer: Hypersonic Database (HSQLDB). The neat thing about HSQLDB is that it can run in-memory, populated by a script, and created when you create a JDBC connection to it. In other words, you can start it when your application starts and shut it down when your application shuts down. I could not find any “great” articles that described how to do this so I started a series on InformIT.com. In the this, the first article, I describe the problem and help my readers setup an HSQLDB environment using Maven. Next week I’ll build out the framework for a simple application that uses HSQLDB in this manner. The follow up to this tries to bring more formality to integrating database access into client applications by (1) defining a service layer using Spring and a proper Object-Relation Mapping (ORM) solution using Hibernate. I think that while we focus on separation of concerns and formality in web applications, when it comes to client applications we fall back to that cowboy mentality and throw proper design to the wind. My hope is that this third article brings home that we should properly develop client applications if we ever want any maintainability. Depending on how far I get building my Getting Things Done (GTD), or in my case “Geeking Things Done”, I’ll conclude the series with sample source code from the application that shows how it can be used in real live.
Take a look at the article (it posted on Friday) and let me know what you think. I’m always looking for good constructive feedback!