Does anyone out there have advice to offer regarding best practices
when creating a database application? Basically, I'm trying to do
some design work here that will allow me to create an object or set
of objects that will be useful across database applications.
The direction I've been going in is to create two new classes: a
MyDatabase class that is a subclass of REALSQLDatabase and a MyTable
class. The MyDatabase class has a property called dbTables that is an
array of MyTable classes. MyTable has a fields as Dictionary
property, a owner as MyDatabase property, a tableName as String
property and a pluralName as String property.
I'm thinking one of the things I should do to abstract the MyDatabase
class is to not have it as a subclass of REALSQLDatabase, but have a
REALSQLDatabase property and, for instance a MySQLDatabase property
(those are the only two I currently anticipate using, although I've
thought of adding FileMaker access through HTTP calls to FileMaker
Server Advanced), as well as a DatabaseType as String property to
specify which database engine to use.
From there I was going to store the database schema as a text
constant in the application, and have methods for creating the table
in the appropriate engine, as well as the rest of the operations that
would be needed for the database, including inserting, deleting,
searching, etc. My thought was that when I want to create a record
using this class, I would call a NewRecord method that is passed a
dictionary of field/value pairs and the NewRecord method would then
insert the record into the database. All the SQL would exist only
within the custom database class, and once it's built I wouldn't have
to generally touch SQL unless I'm editing the functionality of the
class.
Of course, I'm wondering if this is the best path to go down. Would
it be better to simply use the built-in REALSQLDatabase and
MySQLDatabase classes for whichever purpose my project has? Or is
there a better design that someone else has already done for this?
Any pointers and advice would be appreciated.
Thanks,
Chuck
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>