Real Studio makes doing database applications very easy. The strength of the database classes in Real Studio is that they’re generic enough to do almost anything. The drawback to the database classes in Real Studio is that they’re generic enough to do almost anything. No contradiction there, eh?
Database programming in Real Studio can be very tedious. It’s the exact same code over and over again. I generally have Load, SaveExisting, SaveNew, and Validation methods where I am literally just using the same combination of SQLSelect, SQLExecute, InsertDatabaseRecord statements over and over again. Since the IDE has no idea what tables and fields are in the database it can’t help me detect table and field misspellings (a common issue) or tell me when I’m trying to convert data improperly. Depending upon the database data conversion errors will happen silently with no errors (I’m looking at you SQLite and MySQL).
For years we’ve been using ActiveRecord for Real Studio. It’s been a great way to abstract all the boring and tedious database stuff out of the way and let Real Studio work with us and for us. It’s very nice to have AutoComplete work (most of the time) and the compiler warn of datatype mismatches. It’s been a great timesaver but sometimes the work involved creating the classes in Real Studio was a hindrance.
About a year ago we were working on an conversion project where the original app was created in Microsoft Access. The database had a hundred or so tables and some of those tables had two hundred fields in each table (I didn’t say it was a well designed database) and the client wanted a Real Studio version of it for Mac and Windows. Doing all that work of creating the Real Studio classes would have taken twenty or thirty hours (or more) so we came up with a generator to create the classes for us.
This is where ARGen, the ActiveRecord Generator, for Real Studio was born. Since then we’ve used it in a couple of projects and found it very, very handy. It is now available in our web store and lets you scan an SQLite, MySQL, PostgreSQL or Microsoft SQL Server 2008 databases. It then simply generates the necessary classes in a Real Studio XML file that you can open in Real Studio and copy and paste the namespace data files into your own application.
ARGen conveniently adds a generic DBOpen, DBClose, and Register functions into the namespace module letting you start using ActiveRecord as quickly as possible. Each ActiveRecord class then has FindByID and List shared methods for your convenience. Naturally you’ll add your own shared methods over time but it’s a good starting place for most developers.
You can try out ARGen for free but if you want to unleash its full potential it’s a paltry $9.95. I think this is a steal since it might be saving you many, many hours of coding.
Downloads for the Mac OS X and Windows versions can be found at http://www.bkeeney.com/allproducts/argen/
Purchase in the BKeeney web store here.