This is a very interesting approach. The only trouble I
see is that storing your object data in a property array
steals away the ability to reference the data in any
meaningful way.
Would you rather access object data like this:
? Customer.Name
? Customer.PhoneNumber
? Customer.Address
Or this?
? Customer.Data[1]
? Customer.Data[2]
? Customer.Data[3]
I would pick the first approach. However, you could have
descriptive properties and include a method that stuffed
the property array before blowing it into a memo field, but
I imagine there would be severe performance drops.
Just my 2 bits,
Chris Holtz
>Wouldn't it be nice if VFP supported true object persistence? One trick that I've seen work:
>
>- Use a property array to hold most of the data in your object. It can't hold other object references, just scalar data like strings, numerics, etc.
>- To store that data: Do an Acopy(object.array, aTmp)
>- Store to a memo field all like aTmp
>- To Restore the data to the property array, just go the other way.
>
>aTmp can be a local array, It only exists to serve as a conduit.
>
>This technique will move data to and from disk pretty quickly because the transfer is being handled by very little interpreted code.
>
>However, if you want to search your table based on the values of those stored object properties, you need a more granular approach
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement