|
|
|
Ted Roche |
|
Ted Roche & Associates, LLC |
|
|
|
|
|
Pagers and cell phones silent, please. |
|
Rest breaks as appropriate |
|
How to ask questions |
|
Administrivia |
|
Conference Binder |
|
Schedule – Some sessions only given once |
|
Trade Show – T-shirt Tuesday, Drawing Wed. |
|
Evaluations
- help the community |
|
Closing session questions – Wednesday noon |
|
Drink Tickets! |
|
|
|
|
Learn the terminology used in VFP |
|
Understand the tools of VFP has |
|
Understand how VFP stores and retrieves data |
|
Know what applications VFP can create |
|
Know resources to learn more |
|
|
|
|
President of TR&A, LLC Consulting |
|
Microsoft Certified Solution Developer,
Microsoft Certified Systems Engineer |
|
Co-Author of Hacker’s Guide to VFP 6 |
|
Author of Essential SourceSafe |
|
Microsoft Support MVP |
|
|
|
|
Ground Rules & Pop Quiz |
|
Episode I: It’s the Data |
|
Part B: It’s the Coding |
|
Act III: Advanced Topics |
|
Part 4: Putting it all together |
|
Epilogue: So, Now What? |
|
|
|
|
Visual FoxPro is… |
|
… a standalone tool for data manipulation. |
|
… a development tool for standalone, LAN,
client-server, COM and Web applications. |
|
… a database engine. |
|
… a programming language. |
|
… part of Visual Studio. |
|
… an integral part of Microsoft Windows. |
|
… a religion. |
|
|
|
|
|
|
Terminology |
|
Data Design |
|
Normalization |
|
Reading and Writing Data |
|
Transactions and Buffering |
|
Client-Server Data |
|
|
|
|
Field: single piece of data |
|
Datatype: describes contents and limits |
|
Record: single piece of information |
|
Table: set of records |
|
Cursor: CURrent Set Of Records |
|
|
|
|
|
What goes where? |
|
Typically, data is assigned to table that
represent entities |
|
For example, customer, item, video, dancer |
|
Caution: table entities may not be objects! |
|
Field datatypes are chosen to represent data |
|
Data are assigned to the entities owning them |
|
|
|
|
|
Why Be Normal? |
|
Easy applications from well-designed data,
poorly designed data makes for tough apps |
|
Primary Key (PK) uniquely defines record (1st) |
|
All parts of PK required to identify record (2nd) |
|
No other fields needed for uniqueness (3rd
) |
|
When a record wants to refer to another, it
stores the PK of that record. That field is a foreign key (FK) |
|
|
|
|
|
Different tables are related to one another with
primary and foreign key matches. |
|
Ex. Sales order table holds customer FK |
|
Relationships may be: |
|
(Zero or) One-to-one |
|
(Zero or) One-to-Many |
|
Self-join |
|
Relational Integrity (RI) can be enforced with
triggers, RI Builder, or code |
|
Ex. Cannot delete invoice with detail items |
|
|
|
|
|
|
|
Interactive or Programmatic VFP Commands |
|
REPLACE |
|
APPEND (BLANK) |
|
BROWSE / EDIT |
|
DELETE |
|
COPY |
|
SQL Commands |
|
INSERT |
|
UPDATE |
|
DELETE |
|
|
|
|
Data on disk should always be complete and
consistent. |
|
Buffering allows you to make a series of
changes, and have the data in local cursors until you are ready to commit
it. |
|
Transactions allow you to lock the affected
records from the time you start and update until you complete it. |
|
|
|
|
|
Use Client-Server for low-bandwidth, high
security, large amounts of data, or high availability situations |
|
Remote Views |
|
Direct ODBC Functions |
|
SQLConnect(), SQLExecute() |
|
Data appears in VFP as a cursor |
|
|
|
|
Terminology |
|
Data Design |
|
Normalization
Reading and Writing Data |
|
Transaction and Buffering |
|
Client-Server Data |
|
|
|
|
|
|
VFP Commands & Functions |
|
Controls, Forms, Classes & Objects |
|
Event Model |
|
The VFP Toolset: |
|
Project Manager |
|
Form and Class Designer |
|
Code Editor |
|
… and many more |
|
|
|
|
Commands stand alone, functions return values |
|
Structural: DO WHILE, IF, DO CASE |
|
Data: REPLACE, APPEND, DELETE |
|
I/O: @…SAY, LIST, REPORT |
|
Functions: |
|
|
|
|
Controls are the widgets that display stuff,
present actions for the operator to take |
|
Forms are where you place your controls |
|
Classes are the templates for your objects |
|
Objects are the instantiated (running) entities
based on classes. |
|
|
|
|
|
Init() initializes, Destroy() at end |
|
Exception: Form’s DE before form |
|
Error() traps all errors in an object’s code |
|
Activate() and Deactivate() events on focus |
|
Mouse* on mouse events – up, down, move |
|
OLE Drag and Drop supported with a series of
events |
|
Events fire automatically, or when the user
chooses – use events to fire code in methods, never methods to call events. |
|
|
|
|
Project Manager |
|
Form and Class Designer |
|
Code Editor |
|
|
|
|
|
VFP Commands |
|
Controls, Forms, Classes & Objects |
|
Event Model |
|
The VFP Toolset: |
|
Project Manager |
|
Form and Class Designer |
|
Code Editor |
|
… and many more |
|
|
|
|
|
Object-oriented analysis and design |
|
N-tier Design |
|
COM, DCOM, COM+ |
|
ADO and ODBC |
|
User Interface Design |
|
Project Management |
|
|
|
|
RTFM! |
|
Objects are containers of consistent behavior
and the data needed for those behaviors |
|
Encapsulation – behavior & data |
|
Polymorphism – same name, different behavior |
|
Inheritance – overwrite the exceptions only |
|
Composition – use groups of objects to form
complex behaviors – basis for GOF Patterns |
|
|
|
|
An n-tier design is any set of components
communicating via well-defined interfaces |
|
Classic monolithic coding is single (really
zero) tier |
|
Client-server is two-tier |
|
Web apps are often three (interface management « business logic « data mgmt |
|
Programming to interface is difficult but more
flexible, scalable and powerful |
|
|
|
|
Microsoft’s means of managing components |
|
Publish interfaces for others to consume |
|
Pool object in transaction services |
|
Heavyweight framework with runtime expenses |
|
|
|
|
ADO – Active Data Objects – high-level COM
layers on OLE DB interface to data |
|
ODBC – more primitive, less scalable and
manageable interface to data |
|
ODBC supported natively in VFP’s Remote Views
and Connections, SQL* functions |
|
ADO can be interfaced to VFP |
|
VFP 7 first with OLE-DB provider for VFP data |
|
|
|
|
Simpler is better |
|
Programmers typically do not have the proper
mindset for good user interface design |
|
When in doubt, borrow from the work of others |
|
Study the resources available ACM-HCI |
|
Least expensive tool: watch an operator run your
application. |
|
|
|
|
There are no silver bullets – Fredrick P. Brooks |
|
|
|
There are, however, engineering principles: |
|
Estimate it |
|
Measure it |
|
Plan it |
|
Manage it |
|
There are methodologies out there (RUP, Agile,
Crystal, Extreme) learn and use them |
|
|
|
|
Object-oriented analysis and design |
|
N-tier Design |
|
COM, DCOM, COM+ |
|
ADO and ODBC |
|
User Interface Design |
|
Project Management |
|
|
|
|
|
Read The Fine Manuals |
|
Be One With The Fox |
|
Use A Framework |
|
Get A Support Group |
|
Sharpen The Saw |
|
Top Ten Mistakes |
|
|
|
|
VFP Manuals are among the best in Microsoft! |
|
The Help file is huge! |
|
There are many fine 3rd party books |
|
Check out the magazines – Foxtalk,FPA, Code |
|
99% of the questions answered on the forums come
right out of one of these sources |
|
|
|
|
When you choose to ride the tiger,
you must go where the tiger goes |
|
|
|
Learn the FoxPro Way of coding |
|
|
|
|
|
|
Frameworks have 3 – 10 man-years of effort,
large customer base, varied applications |
|
Unlike your own framework, or sample code, these
have been tested in the real world |
|
Customer support available |
|
Manuals and tutorials |
|
|
|
|
How many have solved a problem by explaining it
to someone else? |
|
On-line forums: UT, CompuServe, FoxForum.com |
|
Newsgroups: Microsoft and uunet |
|
User Groups: monthly, free (or cheap),
networking opportunity |
|
|
|
|
|
None of us know it all (except maybe Calvin) |
|
Improve your development and consulting
techniques by: |
|
Attending conferences |
|
Reading journals |
|
Participating online |
|
Reading books (in and out of the industry) |
|
|
|
|
It ran fine on my system! |
|
It worked great with ten records! |
|
I could write that in a week! |
|
We’re just converting an existing system – two
weeks, maybe four weeks, max! |
|
Our situation is unique… |
|
|
|
|
We don’t have time to document it now… |
|
I know how the system should work… |
|
Upper management has no idea what we do. |
|
But, what if…. |
|
Those who fail to learn from the past… |
|
… are bound to be past by those of us who have! |
|
|
|
|
|
|
Read The Fine Manuals |
|
Be One With The Fox |
|
Use A Framework |
|
Get A Support Group |
|
Sharpen The Saw |
|
Top Ten Mistakes |
|
|
|
|
|
DevCon is a great opportunity to: |
|
Learn an awful lot about FoxPro |
|
Learn about emerging technologies |
|
Network for business opportunities |
|
Have some fun! |
|
Go for it! |
|
When you get back home, review your notes, check
the web site for updates, and dig up some of the resources provided here. |
|
|
|
|
|
|
|
|
http://www.Advisor.com/CMF0109p.nsf/w/vfppre |
|
|
|
|
|
|
|
This session WILL / WILL NOT |
|
have updates. |
|
|
|
|
|
|
Thank you! |
|
|
|
|
|
Please remember to fill out your evaluation. |
|