[RB] Newbie warning !! A few questions

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Aug 25 13:47:49 CDT 2003


on 8/25/03 1:13 PM, Jan Erik Moström at lists at mostrom.pp.se wrote:

Hi Jan,

> Once every 6 months or so I start learning using Valentina and every
> time something happens so I have to wait another 6 months 8-) Well, it's
> time again and I need to clarify a few things. I'm making a simple
> database with 6 related tables in order to learn Valentina for future
> use.
> 
> 
> If I create a database and add a baseobject (class 'P') that represents
> people then this represents the whole table, right?

You speak about c++, yes?

YES, that class represent the whole table.
And you will have CURRENT record.
 

> If I want to treat a person as an object (and have several such objects
> available at the same time ... no, not a listing but for editing) then I
> need to create another class 'RealPerson'. When I need an instance of
> 'RealPerson' I should request if from 'P' (who either creates a new
> record or return an existing depending on the situtation), right?

Well, here there are 2 ways

1) if you want to use BaseObject API you can create that helper class that
simply COPY data from CURRENT record and store them
Then yes you can have several instances of such helper class.

2) you can use SQL and cursor API.
For one BaseObject you can have ANY number of cursors.
Even better, cursors provide you record locks, so you will be safe for
EDITING of many records in the same time.

I recommend to use cursors for you.

> If I need to save the changes to a 'RealPerson' object, then I should
> call 'P' with this object as a parameter, right? ('P' looks up which
> record needs updateing and updates it)

Hmm, but class P do not have such functions that will get your RealPerson as
parameter. CorrecT?

You mean you will write this functions self?

Again cursors are better.

> To do this, I need some way to uniqely identify the person in the 'P'
> table using some data in the 'RealPerson' object. Should I assign a
> unique identifier myself or is this one use for the VObjectPtr/RecID?

Enough RecID. ObjectPtr not needed here.

> Or am I completely wrong on everything?

A little.

You think into little hard way.


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list