Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to store objects?
Message
From
20/02/1998 23:11:02
Christopher Holtz
Integral Computer Services, Inc.
Rochester, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00080035
Message ID:
00080254
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform