A little help
Ruslan Zasukhin
ruslan at paradigmasoft.com
Mon Mar 24 12:38:33 CDT 2008
On 3/24/08 3:47 PM, "Trausti Thor Johannsson" <tj at studlar.net> wrote:
Hi Trausti,
> I am just getting over a little hurdle here. There are 1000's of ways
> to use Valentina, but I am trying to do a better way and benefiting by
> using Valentina instead of sqlite or mysql.
>
> In my software, I mostly use 1 table, person table which has links to
> parents, like this
>
> personid int
> name
> ...
> father int
> mother int
>
>
> I use this to go back and forth, finding parents and children and
> grandparents and siblings to name a few things, also to traverse and
> find a common ancestor.
Okay I see. Recursion on single table.
The best task for Prolog, yes? :-)
> What I do currently in my tests, is to use quite a lot of vcursor
> objects, and it seems to be working quite well. So I use like
>
> father vcursor
> mother vcursor
> siblings vcursor
> ....
>
> and find them by sql. And by using Einhugurs datagrid, programing is
> quite easy, just a few lines of code instead of hundreds if not
> thousands of lines.
>
> What I want to know, am I doing this correctly ? Is this a sane way
> of using valentina ? Or is there a much simpler way ?
Yes exists much better and much much faster way in case you work with LOCAL
db only.
Do you need or plan to use Valentina Server?
If no then you can go by API way:
* you will use BitSets or ArraySets to collect and keep
RecIDs of found records.
* you will use this sets to display that records in Einhugurs datagrid
* you will use VFeild.Find( ) and Vlink.Find() methods mo find parent
and children methods.
> Also if it is no bother, would it be better to have a 3rd table with
> parents and children keys ? So many to many connection ?
It needs to think more deeply, but yes its possible also.
and even better then to use VBinaryLink.
it is perfect for this.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list