Re: Newbie: how to build data base
Re: Newbie: how to build data base
- Subject: Re: Newbie: how to build data base
- From: email@hidden
- Date: Wed, 6 Jun 2001 14:15:49 -0700
>
I'am used to 4th Dimention)'s developpement.
>
I'd like now to make a personnal data base using Obj. C - Cocoa, but i
>
got in troubles on how to manage the NSTableDataSource, and more on how
>
i should write the tables to persistant storage with their indexes and
>
'links'.
>
I have no Idea about how to build indexes for Table's fields and how to
>
link 2 Tables with a field from a '1 to n relation'.
>
I'd like to know what is a HashTable, how to build and use one, etc
>
>
does someone know were i could learn about this ?
>
>
Is there something to help me in the Cocoa Framework ?
>
>
I heard about dtf and mysql, could i use such stuff to take care of my
>
data tables when i concentrate my work on the interface in Cocoa ? how ?
>
>
Thanks a lot for your help.
It sounds like you're trying to write a front end to a database, such as
mysql which you mentioned. I wouldn't actually recommend MySQL personally -
if you're looking for something you can use for free while you're
developing (or even for some production work), check out FrontBase
(
http://www.frontbase.com).
I do not know much about 4th Dimension, and do not know whether it is a SQL
compliant database system, but if you're going to write a front-end, you
really need to know SQL. There are likely things that 4th Dimension did for
you that you'll have to do manually. FrontBase is fully SQL-92 compliant,
so I'd recommend finding a good book on SQL and reading it. A lot of the
concepts you are throwing out will become more clear as you learn SQL. When
you're writing a front-end, you're totally responsible for enforcing
business rules; all the database will enforce for you really is the unique
index - which says that no two rows can have the same values in certain
fields specified in a special meta-table called the unique index that the
database maintains for each table you create.
You are also responsible for handling table linking - which means matching
up key fields. With the exception of EOF for WebObjects (no longer
supported in Cocoa separate from WO), almost nothing is done for you the
way it would be in a 5gl Database development environment like 4th
Dimension.
So, if you're going to tackle something like this - you really need to
establish some groundwork first. You need to familiarize yourself with
RDBMS concepts, the SQL language, and THEN start learning Cocoa. With
Cocoa, you're programming closer to the metal than with something like 4D,
PowerBuilder, FileMaker Pro, etc., so it is incumbent on the programmer to
understand all the various stuff that you're not used to dealing with. If
you try to learn all three of these at once, you're bound to get
overwhelmed and frustrated, and give up.
You can probably find a lot of good resources on the Web about SQL and
databases in general. Check out Frontbase, which will give you a good
system to play around with some SQL calls and building tables. Once you're
comfortable with SQL, it's fairly easy to access from Cocoa - FrontBase
provides interfaces for Cocoa.