RunAhead Technologies

 

 

 Products

 FoxDataObjects
 Why Mapping ?
 Product Overview
 Documentation
 Download
 How to buy

 

 Support

 
 News
 Developer Forum
 Support Request

 

 Store

 
 Order Online

 

 [ Site Map ]

 

  Product Overview

 

FoxDataObjects™ (FDO) is a high performance Visual FoxPro object-relational extension library that enables developers to create fully scalable business classes that are persistent to relational databases. Scalable business object classes can be deployed in local (native and client-server) or in distributed (client-server/n-tier) configurations with no modifications to source code.

FoxDataObjects is made up of two main components:

  • a supporting core library that provides the runtime services of the persistence layer: The FDO Library

  • a GUI based mapping tool: The Schema Manager

The core library, written in C++ as a Visual FoxPro Link Library (FLL), provides a natural and high performance extension to the Visual FoxPro language, and includes a set of class wrappers that form a complete, robust and easy to use persistence services object model. The Schema Manager mapping tool allows you to map business classes to database tables and columns, and to specify object relationships at development time. It also can be used to define server side custom SQL, validity checks, and customized database configurations.

FoxDataObjects can jump start application development by reading the structure of existing Visual FoxPro classes, or existing database tables, and generating a default mapping strategy. This default mapping strategy can then be visually modified for further customization.

At development time, whenever the object model changes, the Mapping Engine generates the default mapping information for new or changed classes and members. This way the database schema follows your object model changes.

The mapping strategy is saved to a schema file that is used by the supporting core library at runtime. The core library provides the necessary API to allow your business objects to be persisted in the database.

 

Schema Manager Overview

The Schema Manager, is a powerful GUI tool designed to easily create and edit schema files. It allows you to edit and change all the mapping information between your object model and the relational model interactively, avoiding to type or edit complex XML mapping specifications. You can  use the Schema Manager at development location to make adjustments and fine tuning on your mapping files, parse class libraries, reference other schema files, create and test datasources definitions, connect to datasources, create databases, query databases, query your object model, import existing database schemas and tables, generate class definition from existing tables, etc.

Click on the thumbnails to get a full sized picture of some Schema Manager mapping tool screens:

 



 
Mapping a Class definition


 
Mapping an owned Collection


 
Specifying an owned One-to-Many relationship


 
Showing resulting ERD diagrams


 
Showing resulting ERD diagrams


 
Editing a Database Table definition


 
Adding a new Table Index


 
Testing current session database connection

 

Persistence Engine Overview

This mini-tutorial will introduce you some of the FoxDataObjects Persistence Engine basic features:

Assuming your classes has been defined and mapped (either automatically by the mapping engine or by using the Schema Manager mapping tool), all your code need to do to gain access to all the FoxDataObjects API services is to issue a:
 

SET PROCEDURE TO fdo ADDITIVE


This simple line of code opens an amazing new world of possibilities to your business objects. The next examples show a basic usage of persistence services.
First step is to create a Server object that will enable us to get fully connected Session objects.

 

oServer = CREATEOBJECT("fdoServer")

 

The Server object allows you to define default values for new Session objects, like a default datasource object, default mapping schema file, and so on. To simplify, lets use the datasource object for Visual FoxPro databases automatically created on Server object instantiation.

 

oServer.DefaultDataSource.Database_Path="C:\MyData\"

oServer.DefaultDataSource.Database_Name="Contacts"
 


Let's create our Session object:

 

oSession.oServer.NewSession("Contacts.FDO")

 

Now we are connected to the database, the database schema is up to date and we are ready to save/retrieve/remove objects from the database:

 

oCustomer = CREATEOBJECT("customer")

oCustomer.FullName = "John Strass"

oCustomer.Address = CREATEOBJECT("address")

oCustomer.Address.Street = "362 St.Martin Avenue"

oCustomer.Address.City = "New York"

 

And save the object to the database:

 

oSession.SaveObject(oCustomer)

 

To retrieve a simple object we can use something like:

 

oJohn=oSession.GetObject("customer","FullName LIKE 'Strass' AND Address.City='New York'")

? oJohn.FullName ---> "John Strass"

? oJohn.Address.Street ---> "362 St.Martin Avenue"

 

And to remove the object from the database :


oSession.DeleteObject(oJohn)

 

To query for a set of objects:

 

oQuery=oSession.NewQuery("SELECT OBJECTS FROM customer WHERE customer.address.state='NY'")

? "There are ",oQuery.Count," customers in NY"

FOR EACH oCustomer IN oQuery.ITEM

? oCustomer.FullName,oCustomer.Address.Street

ENDFOR

 

And it is just the beginning...

Do you see, in the previous samples, any SQL statement, CREATE TABLE , SELECT, INSERT , UPDATE, or connection statement ?
 

No. All of this work is done for you by FoxDataObjects. Just change your datasource object, and it will work again on a completely different database !!,

... and you've just used five simple persistence methods.
 

 

Tutorials

These tutorials will introduce you on the FoxDataObjects basic concepts. To keep tutorial files down to a manageable size, we splitted them into several short movies, so we recommend to watch them in order. Click on the links to see the tutorials. You need Macromedia Flash installed on your computer.

Basic Tutorials

 

Intermediate Tutorials

(Comming soon)

 

Advanced Tutorials

(Comming soon)

 

 

 

     

 

 Copyright © 2000-2005 RunAhead Technologies, All Rights Reserved. [ Terms of Use | Privacy Policy ]
Please direct your questions or comments to webmaster@runahead-tech.com
Microsoft, Visual FoxPro, and the Visual FoxPro logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Other products and/or company names may be trademarks or registered trademarks of their respective owners.