Re: Class design question
Re: Class design question
- Subject: Re: Class design question
- From: Ken Tozier <email@hidden>
- Date: Sun, 13 Feb 2005 14:36:15 -0500
On Feb 13, 2005, at 2:11 PM, Andy Armstrong wrote:
On 13 Feb 2005, at 18:44, Ken Tozier wrote:
Sort of. I'm writing a database app (for a learning experience among
other "better" reasons) and so need much finer control of the disk
reads and writes than "initWithContentsOfFile" permits. I need to be
able to access any chunk of data anywhere in a file that could
potentially be terabytes in size, so need a way to jump to spots in a
file, read a chunk of data and decode it correctly. Although I'm
factoring the data by size and type, I want to support all of the SQL
types in addition to some richer types and capabilities than SQL can
do natively. This means that I need either a class for each SQL type,
or a function pointer array arrangement to correctly decode the saved
data.
Unless you're going for fixed length records you're going to need to
work out an internal structure for your file which allows you to
allocate chunks of space in the database and an index that tells you
where to seek to for a given record number. And you'll have to
implement indexes most likely. Those would seem to be the real design
issues.
Indexing is the part I do have solidly worked out. The basic conundrum
was: Do I use the easier to maintain (and highly bloated) one class for
each type, or go the more obscure, yet highly compact, function pointer
route. I'm equally comfortable with either but if this project gets to
a decent state, I'm thinking of open sourcing it and want to make it
friendly enough that other programmers won't be completely confused.
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden