I like that approach (of encapsulating PalmOS functions). I find myself
doing this with other PalmOS systems, such as the UI functions. Nothing is
worse than the deja vu of reinventing the same code over and over again,
over and over again. ;-) ;-) Even the starter templates do this with handle
and pointer lookup functions.
To that end, I've been writing a small database engine, called DBQuick, that
sits atop the PalmOS storage system, yet it is designed in layers so as to
port easily to other platforms such as CE. The primary advantage to this
little engine is it lets you stop (the madness!) reinventing all that code
for working with fields, and it abstracts the peculiar PalmOS database
manager into a more familiar PC-like table "object." In addition, the tables
are self-describing, much like a DBF file. This offers some opportunities to
genericize things like data-bound grids.
Future "modules" are in the works to allow more than one index per table,
relational joins, and even a mini-SQL interpreter. Some of these may
ultimately require more memory or horsepower than the PalmOS devices can
reasonably provide, but they might have room in CE. Actually, I'm hoping to
fit in these extras for PalmOS anyway, even if they end up somewhat
abbreviated in form.
So far, it is going very well and makes the application code much easier to
write and understand. I'm aware there are some similar projects out there
like this, but it's one of those things where if you can't find exactly what
you're looking for, do it yourself! If we end up with a marketable product
in the end, so much the better.
If anyone is interested, I can post some sample code illustrating how one
uses the DBQuick API. I suppose at some point in the near future we could
use a few beta-testers, but no firm ideas on that yet. Feel free to e-mail
me if interested, though.
--
Geoff Shepherd
Chief Software Architect
Hayton Systems+Applications
mailto:[EMAIL PROTECTED]
http://www.haytonsystems.com
----- Original Message -----
From: Kevin O'Keefe <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 29, 1999 5:05 PM
Subject: RE: Creating lots of Databases
> There is a great deal of general database functionality that can be put
into
> a "common" src file. These include open (encapsulating the find, etc.),
> close, etc.
>
> Here is an example of a common DBUtils.h that we have generated from
several
> projects:
>
> DmOpenRef DBCreate(char *name, ULong creator, ULong type, Boolean
> bDeleteOld, UInt openMode);
> Boolean DBDelete(DmOpenRef dbRef, char *name, Boolean bUnlock);
> Err DBSetBackupBit(char *name);
> LocalID DBFind(char *name);
(snip)