[Lazarus] Postgres database again...

Damien Gerard milipili at shikami.org
Tue May 27 16:04:07 CEST 2008


Le May 27, 2008 à 3:46 PM, Graeme Geldenhuys a écrit :

> Damien Gerard wrote:
>> Your app should not never be dependant of Primary keys.
>> Finding the good id should be the work of you DB and not your app.
>
> My app does not create the primary keys, it's the job of the Object
> Persistence Layer (tiOPF) that I use.  Each business object  
> (descendant
> of TtiObject) has a OID: TtiOID property. The developer can register
> what OID Manager to use (Strings, GUID, Integer, Int64 etc) You can  
> even
> mix them (multiple OID Managers) in a single application.
>
> The OPF manages the loading and persisting of my business objects. I
> simply call Load or Save. Even if I switch the backend storage from MS
> SQL Server to Firebird (or even CSV, Tab Files, XML, DBF etc), it  
> makes
> no difference in my code. The process of loading/saving the data stays
> the same.
>
> I also use proxy objects (I think that's what you call it). I load a
> 'lite' version of my objects (to conserve memory) and only load the
> 'full' remainder of the data per object when needed. So having many
> concurrent users with a large database doesn't cause much problems. We
> don't keep everything in memory, we free things off when not needed.
>

Actually you see the problem from another point of view and it is  
interresting.
I will take a glance at tiOPF.


> When you have database tables with a couple million records you  
> quickly
> learn never ever to do a 'select * from tablename'. You quickly become
> very specific with what data you need and only return that.

Sometimes no choice ... :(


> But now I'm lost... I can't remember what this original thread was
> about... ;-)


Indeed :)



--
Damien Gerard
milipili at shikami.org

"Intelligence is 10 million rules."
    -- Douglas Lenat









More information about the Lazarus mailing list