Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alternative to Foxpro
Message
De
07/02/2008 16:39:21
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Alternative to Foxpro
Divers
Thread ID:
01290605
Message ID:
01290605
Vues:
273
I am using foxpro for many years.

After transfer to .net platform (in 2003 C# and Winforms ) no any data handle mechanism happy to me.

There are several way to handle data in .NET platform
ADO.NET
ORM tools :

Nhibernate
Castle ActiveRecord
Subsonic Active Record.
dOOdads
EntitySpaces

and others..

all that have headcache for foxpro style devolopment, except Subsonic (according to my experience)

subsonic Active Record seems very comfortable for Foxpro devoloper .
Many data accees habits covering by Subsonic Active Record.

I think First advantage Subsonic for Foxpro devoloper is
entity corresponding directly by table.

In Foxpro, for devoloper base entities are Tables (for database related app)
Design table and use it in Bussines rules In UI etc.

Subsonic have Subsonic ToolKit.
Subsonic can generate your entities from Database schema automaticly for you. Only one right Click nedded. :)
And all things are open source.

I try explain CRUD(Create,Read,Update,Delete) operation compare with Foxpro.

For Example
We have 3 table , Product,Orders,Suppliers

Supplier
ID
Code
Name
..
..

Product
ID
ProductCode
ProductName

Order
ID
ProductID
SuppliersID
Date
....
...

And you see Order table have 2 Releation. One of them With Product (represent by productID) other is SupplierID.


CRUD Operation like that

For New Supplier:

Supplier supRec = new Supplier(); //Scatter blank

supRec.ID = Guid.NewID() //or another thing
supRec.Code = "SupCode1";
supRec.Name ="SupName1"

supRec.Save(); //Gather

For update Rec.

Supplier supRec = Supplier.FetchByID(KeyValue) // SEEK("Supplier",KeyValue)
supRec.Name ="NewName1"
supRec.Save(); //Gather

Gets Sets of Record
also you can using scan logic


//We are going to load RecordSet from database
//Suplier Type and SupplierCollection collection Type and other
//Database tables class Generated by Subsonictool.
// You dont need write single line of code.

SupplierCollection supColl = new SupplierCollection ();
//Thre are several way load Collection.

supColl.Load(Suplier.FetchByQuery(new Subsonic.Query("Product").
WHERE("Code>100").AND("NAME>A")));

int i =0;
foreach (Supplier supRec in supColl)

//SCAN begin. for each record we add i value end of Name :)..
{
supRec.Name = SupRec.Name+i.ToString();
supRec.Save();

} //end Scan


Delete record operation.
Supplier.Destroy(KeyVlue);

and you can Access Supplier info over Order Info like that
Order.Supplier.code (good stuff)

And there are lots of tons nice thing.

for detail info

http://www.subsonicproject.com/
http://blog.wekeroad.com/ Father of Subsonic now at the microsoft for MVC innovation.
Répondre
Fil
Voir

Click here to load this message in the networking platform