Help  |   Contact Us  |   About Us  |   News and Events
Books, conferences, and other information about... Moving to Linux Switching to OOo Building Linux Apps Using Visual FoxPro
Buy      Download      Your Account      Catalog      Support      Conferences      Resources      Fun

Effective Techniques for Application Development with Visual FoxPro, 2nd Edition (VFP 9.0)
Table of Contents

In The Beginning 15

Finding out what needs to be done
What do we know?
What does the client know?
Herein lies the conflict
Having a plan
Iterative development

The Application 19

System-level services
The Kickoff
Clean up the environment
Before Main.prg
A function launching mechanism
Flexibility during development

Data - Keys and Indexes 31

What are keys?
Primary and candidate indexes
Compound primary keys
Surrogate primary keys
Implementing surrogate primary keys
Visual FoxPro indexes
Index types defined
Regular indexes
Unique indexes
Candidate and primary indexes
Filtering indexes
The roles that indexes play
Ordering the records in a table
Data filtering
Optimizing performance
The DELETED() index
Managing relations
Persistent relations
Temporal relations
Indexing views

Data: Accessing Our Data 47

Where is the Data
The SELECT Command
Using SELECT to Access Our Data
Adapting to Cursors
Data Stored Outside of Visual FoxPro
Using a DSN
Creating a Connection without a DSN
SQL Pass Through
Adapting the CursorAdapter for Remote Data
Providing Data for Processing
Providing Data for Reporting

Rules, Triggers and Referential Integrity 71

Rule and trigger functions
What are rules and triggers?
Rule behavior
Field and row rule behavior
Data validation
Data modification using rules
Trigger behavior
Referential integrity
Implementing referential integrity rules
The VFP Referential Integrity Builder
Referential integrity logic
Algorithms for cascading and restricting changes
The whole enchilada—a universal referential integrity function
All emptors be caveat!!
Other stuff to do with triggers

Data Manipulation Classes 97

Common data manipulation requirements
Opening and closing tables and views
Detecting changes to data
Committing or canceling changes to data
Navigating through data
Providing data source independence
Buffering Data
Which buffering mode do I use?
Data manipulation classes
The native Visual FoxPro classes
DataEnvironment class
Data sessions
Cursor class
CursorAdapter class
Relation class
Sub-classing the native Visual FoxPro data management classes
Creating our own data-manipulation classes
Data form class
Setting the path
Cursor and Relation classes
Enhancing the cursor class
Data behavior class
Dividing the behaviors
Detecting changes to data
Managing multi-table updating—transactions
Data management and views
Summary of data management

Managing Business Logic N-Tier System Design 155

What is n-tier system design?
What is business logic?
How is business logic different from data validation?
Building business logic enforcement classes
Abstraction of business logic into a class design
Building a subclass
Implementing business-logic classes into an application
What’s the point?
Using COM servers for business-logic objects
Let’s use your server
Where’s the beef?

Forms 177

Loose coupling and forms
Private data sessions
Sharing data sessions
Making the modal/non-modal decision at runtime
Passing data between forms
Other issues with private data sessions
form or not to form—running forms as object instances
Forms and delegation
Forms as business objects
Passing parameters in form methods

Form Controls 197

The general use of form controls
Graphical CheckBox
Drop-down combo
Drop-down list
CommandButton and CommandGroup
PageFrames and Pages
What about speed?
Misusing and abusing the controls

Advanced Form Controls 235

Delegating to form controls
Enabling/disabling controls
List objects
So tell me, which technique should I standardize on?
List objects: an example of a reusable class
List objects: Alias and Fields RowSourceTypes
Setting visual properties example: ColumnWidths
Disappearing objects, multiple objects, and composite objects
Timer-mediated program delays
The trouble with grids
Life without grids (well, almost)
Are grids still useful?
Is that all there is?

User Interface Design, 259

Selecting the „Best” Way to Present Information to the User
The three interface styles
Making the user look stupid
Causing the user to make big mistakes
Slowing the user down so he doesn’t get an adequate amount of work done
Preventing fun and boring the user
Two major application categories
Sovereign applications
Transient applications
Why bother to classify applications?
Modeless vs. Moded and Modal vs. Non-Modal
Controlling edit/add/view functionality
User-initiated edit/view modes
Automatic edit/view modes
So what’s the answer?
Heads-down data entry
Keyboard vs. mouse, and buttons vs. toolbars vs. menus
Limiting the number of dialog boxes
Using the tabless PageFrame to provide multiple „views” of the data
Selecting items
Direct manipulation
Connecting things
Drag and drop
Native drag and drop
OLE drag and drop vs. native drag and drop
OLE itself
The objects involved
The OLE data object
The drag operation
Action and reaction
Now let’s put it to use
Let’s Summarize This
When is drag and drop a good idea?

Manager Objects, the Non-Visible Application Objects 293

What are these non-visible objects?
Managing the activities of an application
Form manager
Menu manager
Security manager
Error manager
Developer’s interface
The Visual FoxPro Application Wizard
General tab
Credits tab
Data tab
Forms, Reports, and Advanced tabs
Visual FoxPro foundation classes
The Application Wizard and the Application Builder
Parts of the framework
Startup program
Classes tab of the Application Builder
The rest of the classes TimeAndBilling_app
Form management
Report management
Menu management
Security management
Error handling
Addition Local Error Handling
Extending the foundation classes
Modifying the code in the class definitions
Sub-classing the classes in the foundation class libraries
Using the hook methods provided in the foundation classes
Creating decorator classes
Creating mediator classes

Moving Data Around with XML 347

What is XML?
How can we use XML?
What are the tools we need?
Using the XML DOM
Reading XML with the DOM
Creating XML with the DOM
Transforming XML to something else (XSLT)
XSLT: the Language Constructs
Using the DOM to Transform XML
Visual FoxPro’s XMLAdapter
Putting it all together

The Report Writer 389

Report Builder Extensibility
Multiple Detail Bands
Previewing Reports with a Custom Preview Container
Generating Reports to be E-mailed

VFP and the Internet 407

Where does the internet/intranet fit into our applications?
The corporate intranet and data reporting
The World Wide Web and application access
Multi-Layer architectural design
Building the Business Class
Creating the DLL so we can instantiate the COM class
Designing a VFP form to use our business class
Leveraging ASP to provide an internet/intranet presentation layer
Setting up a web site
Creating our Default.htm file
The Customer.asp page
The CustomerSubmit.asp page
Wrapping it up
Bringing together XML/XSLT, Visual FoxPro COM objects, the Microsoft XML DOM, and ASP pages to provide a web based reporting system
Where do you go from here?

Developer Tools 449

Tips for effective use of the native VFP developer tools
The project manager
Form Designer tricks
Layout tricks
Instantiation order
Form (.SCX) file corruption
The Class Browser
The Visual FoxPro editor
The VFP debugger
Trace window
Watch window
Call Stack window
Debug Output
Locals window
Code Coverage/Profiler
Coverage Logging
Coverage Profiler
Roll-your-own tools
Invest in your toolbox

Relational Database Design 469

What is a relational database?
The database design process
Getting the information from the client
Designing the database
Determining the referential integrity rules
The process of normalization
1st normal form
2nd normal form
3rd normal form
Boyce Codd normal form
4th normal form
5th normal form

Debugging 489

Whose coding error is it?
The Scientific Method
Data gathering
Frankenbach’s postulate and random fixes
Reproducing errors
Different Families of Bugs: The Good, the Bad, and the Ugly
The Crashing Variety of Bugs
Bugs due to inadequate product knowledge
Bugs due to unexpected triggering of events
Bugs due to erroneous assumptions
The benefits of debugging
Using the Visual FoxPro Debugging Tools
Where is the problem?
After problem localization, bring in the Trace window
Performance problems
The hard ones