Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Support ODBMS
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00121486
Message ID:
00121574
Views:
20
>Would Vfp support 'persistence' which is the most important advance of ODBMS?
>

You could implement persistent objects by implementing save and restore logic for each class, letting you save the state to a database, returning a unique ID for the saved object state, and then instantiating a new instance of the class and restoring the state from the saved state ID. This is not provided automagically, as it would be by an ODBMS, but would require fairly extensive programming. I've done this before where I've needed to maintain stateful business object persistence, creating a separate database to hold object state data.

VFP is not going to perform automatic instance maintenance; you're going to have to add code so that whenever an object reference that may already be created is made, the current work environment is checked to see if it's presently in memory, and if not, go to the backing store and restore it. You'll have to implement logic to save objects whose persistence is by default longer than the current task, to make certain that multiple isntances of the persistent object are not instantiated at the saem time, and to remove objects from the backing store when they are destroyed in memory as well.

If you really need an ODBMS, especially with complex abstract object modelling, VFP is not going to get the job done easily. I've used ObjectStore in the past, and where it's appropriate, it's a far better choice than trying to use VFP as a backing store for a set of wide-ranging persistent objects.

>
>>It depends on what you mean by using it to creaste an object database. VFP is a relational model database, it could be used as an object storage table, relying on fields in tables to represent properties of an object and embedded links to other objects in the object table. You can save and restore objects explicitly in structures in the .DBF with some code added to your classes to support storage and retrieval of objects, and anything really strange can make use of memo/general fields as BLOBs. It's not ObjectStore, and it doesn't have the datatypes built into most object languages for creation and storage of objects with permanence, but you can store object states in tables
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform