Home     Article Archive     Feed     Contact Search

Popular Articles
Upland Bird Hunting
Porter Cable
Italian Cooking Vacations
Irishgenealogy
Apple Diet
Wood Bird Cages
Irish Ancestry
Home Brew Forum

Blogroll
Pet Sexy.
Gamed Owner
Toy Parlour
Game Fringe
Bath Divine
Home Tactic
Home Combat
Sunbeam Home
Home Soak
Mission Yard
Curt Yard
Safety Freaks

Marketplace

Rec.models.scale

Rec.models.scaleData Aware construction classes in the Visual FoxPro 2: Use of Transportation data and temporary storage

Abstract:

In the last article (Part 1), we saw how to encapsulate the data access code and business rules in Visual FoxPro using the classes contained in Visual Class Libraries (. Vcx) files. However, most programs Visual FoxPro, need to provide a means of data entry, retrieval and navigation, which is why many programmers to provide data navigation buttons (next, previous buttons and name) . This is one reason why Visual FoxPro programmers have simply added the required tables to the data environment of the form or report as well, making the data natively in the form layout. If access to data and the validation code is encapsulated in classes, how the data will be returned to a form and how can data-bound forms to build? This article aims to demonstrate that you can build effective, powerful, efficient, applications of flexible database, even if your data access code is encapsulated in "common data classes. This article explores the use of tables as the data transport and cursors as places of temporary storage for forms.

Introduction

In Part I of this article, it was shown that the encapsulation of data access code and business rules in classes made the code easily accessible from the various modules of your application and avoids having to write code access the same data repeatedly in different application forms in your application. In addition, communication and exchange of data between the form and class was using the properties (members) of the class. If your application (UI) necessary to save documents created by the user, the properties (variables or members) of the class have been updated with the values entered into controls on the form and method Save the class was called.

Similarly, when a user needed to display an existing record, the property EmpID class has been updated and the Find method of the class is open to locate the folder. When the file was located, the properties of the class (eg the object created from the class) will be updated with the values of the record found that the form can then display the value of each property in corresponding form controls (eg text boxes).

Although this method works in general and may be effective to work with unique records in a small system, what happens when you need to return more than one record at a time as in the above scenario? Is there another way to transmit data to a class or return the data it contains?

What is the problem simply by using the properties?

To begin, let us only consider the disadvantages of just using the properties as described! While working in this way is simple and works generally, it has several disadvantages such as: 1) Your ability to process more than one record at a time is extremely limited because the property variables can contain data for a one record at a time. This means that if you want, for example to fill a listbox on your form, an alternative mechanism would certainly be appropriate since you have not added pictures to the environment of your form data (but delegate all access data and code recovery of your data current level), 2) If your application has been implemented in a networked environment, each property that you set or retrieve cause a return on the network (especially if your classes have been compiled as components of automation and hosted remotely on a remote machine).

How better it would be able to transfer all the files to backup at a time or return all the records you need to use the same time! Not only does this solve some problems detailed ABO.

Posted on April 22, 2010.
Share |

Comments

There are no comments.

Leave a Comment

Your Name
Your Email
Comments
Human Check. Type 4134.