« If I were... | Main | Robert Kuttner knows nothing about the Free Market »

JPA-compatible alternative to JScience

I'm going to submit part of my CORM project for the Google Summer of Code. Maybe the entire project, actually. The goal is big enough and the end is truly within sight for this great project.

About five weeks ago I hit a major roadblock with my development effort on the CORM project. JScience was not built with persistence in mind. Now, don't get me wrong. JScience is a pretty cool project, and I was certainly excited to find it last autumn. However, you should always pick the tools appropriate for your task.

My task is threefold:


  1. Represent arbitrary quantitative units and their relationships in a JPA compatible way.

  2. Represent product instances, product types, and money as quantitative units.

  3. Perform conversions via dimensional analysis using an external conversion context, such that each unit is unaware of its relationship to other units.

All three points are very important to the success of my project. JScience is geared toward real-time computing, not toward a simple and elegant JPA/EJB compatible object model. It performs some dark arts regarding memory access and garbage collection under the hood that I do not completely understand and cannot trust in a distributed environment. It does not decompose cleanly. Its classes are often not extensible. In short, it is not the correct tool for my needs. It might be for yours, though. And the developers seemed very professional.

So, I built a quantitative library for CORM. I'll be showcasing it as soon as I iron out one more problem with its implementation, involving interfaces. JPA is downright hostile toward interfaces, and why not? They are abstract, so have nothing to persist. The error is my own for abusing generics in lieu of a less elegant field to represent which quantitative property is measured by a given unit. For example, the candela measures the quantitative property called "luminous intensity".

A thorough description is beyond the scope of this entry, especially because this in this neighborhood of the physical sciences, words tend to lose their distinction. What exactly is the difference between a "metric" and a "measure", and "measurement"? What's the difference between a "quantity" and a "measurement"? Non-trivial question, that.

Anyway, code is forthcoming. Possibly over the weekend if I can get done with my VDM-SL homework done.

TrackBack

TrackBack URL for this entry:
http://blog.lib.umn.edu/cgi-bin/mt-tb.cgi/73019

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)