Hi all! I met a number of you at NI Week, and I'm looking forward to getting more involved with LAVA.
I've been working on an Object-Relational-Mapping (ORM) system for LabVIEW objects. I want to gauge the interest in developing this into an open-source package.
The jist of it is a 'presistable object' class that can be inherited. The child class overrides a VI to provide the necessary SQL schema information and the object's internal data (can be as simple as passing the child's private data as a cluster variant, plus a few constants) and a VI for the parent to set data with. The parent class then provides the Load, Insert, Update, and Delete functionality by dynamically building and executing the queries, and acting on the child.
I've gotten this far, but there's a huge list of features I haven't gotten to implement yet, though I think many will be easy once a versatile enough architecture is built. Things like:
- Connection pooling
- Atomic transactions with roll-back
- Aggregation:
. - Proper handling of object relationships and heirarchy
. - Allow for collections of objects, and optimize the SQL queries to batch operations together
. - Allow selective child loading (i.e. a 'car' class contains a collection of 4 'tyre' classes, they may (or may not) be loaded at the same time as 'car')
(and many more)
Current status: still contains some proprietary code, I'd have to remove this first before I could share it, and it's not well documented yet. It's on its 3rd iteration and at the point where I've learned enough that I'd want to start again fresh to improve the architecture, but I think I want to attempt to implement aggregation first, since I'm sure many new architectural issues will surface. I could really use input on the architecture of the design, especially from people familiar with LVOOP or ORM's. There's also a lot of good old-fashioned work to fill out all the features and test everything.
If you're familiar with some of the ORM's out there, this is nontrivial, but useful and challenging. There will also be some good spin-offs. I've already built a great library that simplifies and extends the LV db toolkit (like load/save cluster with strict late-bound typing, NULL representation for native LV types, etc.).
Let me know if you're interested in this kind of project (to use or contribute to).
Cheers!
- Dan Lauber