Title: Jim Booth
1Visual FoxPro 6.0Seminar
- Presented by
- Jim Booth
- Email jbooth_at_jamesbooth.com
- In cooperation with Rainer Becker and the German
FoxPro Users Group (dFPUG)
2General Issues Related to Development
- Understanding the costs
- Lowering the costs
- The Value of Conventions and Standards
- The Value of Object Oriented Design
- The Development Cycle
- Managing Risks
3Database Design
- Characteristics of a Relational Database
Management System - Normalization of Data Design
4Normalization
5Why bother with Normalization
- Reduce the possibility of data inconsistencies
- Reduce the space required for storing data
- Reduce possible update and delete anomalies
- Increase the stability of the data design
6First Normal Form
- Reduce entities to first normal form (1NF) by
removing repeating or multi-valued attributes to
another, child, entity.
7First Customer Pass
Customers
Customer
Company Name Address Contact 1 Contact 2 Phone
1 Phone 2
8Removing the Repeating Groups
Contacts
Customers
Customer Contact
Customer
Name Address Phone Code
Company Name Address Contact 1 Contact 2 Phone
1 Phone 2
Phones
Customer Phone Code
Area Code Phone Number
92nd Normal Form
Reduce 1NF entities to second normal form (2NF)
by removing attributes that are not dependent on
the whole primary key.
10Invoice Line Item File
Invoice Number Line Number Customer ID Product ID
11Remove the Non-Dependent Fields
Line Item
Customer ID
Invoice
123rd Normal Form
Reduce 2NF entities to third normal form (3NF) by
removing attributes that depend on other, non-key
attributes (other than alternate keys).
13Purchase Order
Order Number Vendor ID Vendor City
14Remove Fields Depending on Non-key attributes
Purchase Order
Vendor City
Vendor
15Boyce/Codd Normal Form
Reduce 3NF entities to Boyce/Codd normal form
(BCNF) by ensuring that they are in 3NF for any
feasible choice of candidate key as primary key.
16An Employee Table
17An Employee Table
18An Employee Table
19Fourth Normal Form
Reduce BCNF entities to Fourth normal form (4NF)
by removing any independently multi-valued
components of the primary key to two new parent
entities.
20Employee - Skill - Objective Table
Name
Skill - Name
Objective - Text
Jones accounting more money
Jones accounting prestige
Jones public speaking more money
Jones public speaking prestige
21Fourth Normal Form
Employee - Skill
Name
Skill - Name
Employee - Objective
Name
Objective - Text
22Fifth Normal Form
Reduce 4NF entities to fifth normal form (5NF) by
removing pair-wise cyclic dependencies (appearing
within composite primary keys with three or more
component attributes) to three or more new parent
entities.
23Retail Store Buyers
Buying
Suppose Liz Claiborne adds jeans to their list of
products. We need to add two updates to our
table because both Mary and Sally buy jeans and
buy from Liz Claiborne.
Buyer
Vendor
Product
24Fifth Normal Form
Buy-Vend
Vend-Prod
Buy-Prod
Vendor
Buyer
Buyer
Product
Vendor
Product
25Denormalization
Normalized
Name
Postal Code
Postal Code
City
Address
Country
Postal Code
Denormalized
Name
Address
City
Country
Postal Code
26Want to read more?
27Visual FoxPro Database Container
- Data dictionary
- Relationships
- Field level domains (Field Rule)
- Table level domains (Table Rule)
- Referential Integrity
- Stored Procedures
- DbGetProp() and DbSetProp()
28View Designer
- Updateable
- The Update Tab in the view designer
- Joins
- Inner
- Outer
- Left, Right, and Full
- Top N
29Using SQL in the Visual FoxPro Language
- Why use SQL at all?
- The SQL Commands in Visual FoxPro
- SELECT
- UPDATE
- DELETE
- CREATE
- INSERT INTO
30Designing User Interfaces
31The User Is In Control
Principle 1
32Follow The Object-Action Paradigm
Principle 2
33Be Consistent
Principle 3
34Make ThingsSelf Evident
Principle 4
35Pay Attention To Aesthetics
Principle 5
36Give The User Feedback
Principle 6
37Be Forgiving
Principle 7
38Object Oriented Development
39OO Terminology
- Class
- Object
- Abstraction
- Polymorphism
- Inheritance
- Messaging
- Containership
40Analysis and Design in an OO world
- The Iterative Approach
- Inception
- Elaboration
- Construction
- Analysis, Design, Coding, Testing,
Implementation, Training, Maintenance/Evolution - Transition
41Analysis and Design in an OO world
- There is a constant looping back in this OO
development cycle. - New requirements discovered during coding or
implementation feed back into the design phase. - New functional requirements discovered alter
future iterations
42The Visual FoxPro Class Designer
- Save As Class menu option
- Adding properties and methods to a class
- Specifying an Include file for a class
- Creating subclasses
- Adding controls to the form designers toolbar
from your Classes
43The Application Framework
- What is a framework?
- The overview of the architecture of the framework
- Strategies for maximizing maintainability
44The Framework In Detail
- The Application Manager
- The form class
- The startup program
- Building an application using the framework
- The form
- The Menu
- Enhancing your framework
45Form and Class Design
- Coding methods in a reusable way
- Using THISFORM, THIS, and the Parent property
- Using WITH/ENDWITH
- Using collections to address the contents of a
container
46Simple Base Classes
- Label, Textbox, EditBox, CheckBox,
- Option Button, Option Group
- Command Button, Command Group
- Spinner, Image, Line, Shape, Timer
- Container, and Separator
47Complex Base Classes
- ComboBox, ListBox, and Grids
- PageFrames
- Custom, Container, and Control
- Form, Formset, and Toolbar
48Using Builders
- The Visual Foxpro Builders
- Make it easier to setup the complex controls
- Building your own builders
- Builder.dbf and Builder.app
- ASELOBJ()
- Using the special Builder property of a class
49OLE Base Classes
- OLEBoundControl
- Bound to a General Field in a DBF file
- OLEControl
- Predefined contents at design time.
50ActiveX Automation
- Structure of ActiveX
- Direct Manipulation of an ActiveX server
- Automation of an Object Inside of an OLEControl
51Multi-user Issues
- What is the multi-user problem?
- Two strategies (Philosophies)
- Optimistic
- It is unlikely that there will be a problem when
I try to save. - Pessimistic
- It is very likely there will be a problem when I
try to save.
52Data Buffering
- How did we do this before?
- Whats new and different now?
- Row versus Table buffering
- Pessimistic versus Optimistic buffering
- Choosing the correct buffering mode
53Setting the Buffering Mode
- CursorSetProp() (CursorGetProp())
- Using a Cursors BufferModeOverride property
54Saving Buffered Edits
- TableUpdate()
- TableRevert()
- GetFldState()
- GetNextModified()
55Transaction Processing
- The all or none approach
- BEGIN TRANSACTION, END TRANSACTION, and ROLLBACK
- Resolving conflicts using CURVAL() and OLDVAL()
56Client/Server - Is It For You?
- When does Client/Server make sense?
- Security
- Scalability
- Central Control of Data
57Remote Data Sources
- Setting up data sources under Windows (95, NT,98)
- Connections in Visual FoxPro
- Using Remote Views
- Using SQL Passthrough functions
58Designing Client/Server Applications
- User Interface Design
- No more BROWSE of the customer table
- Awareness that your code does not have absolute
control over the data updates.
59Using Visual FoxPro to Create an ActiveX Server
- OLEPublic classes
- Designing the Server
60Creating Your Own ActiveX Automation Servers
- In-Process versus Out of process servers
- DLL versus EXE
- Compiling the server
- Registering the server
- Using the server
61The Visual FoxPro Debugger
- The debugger as a developers tool
- Choosing a FoxPro frame or the debugger frame
- Saving and restoring debugger settings
- Hot Keys in the debugger
62The Debugger Windows
- Trace
- Watch
- Locals
- Call Stack
- Output
- SET DEBUGOUT TO
- Event Tracking
- Setting Breakpoints
63Coverage Analysis/ Application profiling
- SET COVERAGE TO ltFileNamegt
- Turning coverage on and off
- Using the Coverage Profiler
64Using Assertions
- The ASSERT command
- SET ASSERTS ON/OFF
65Using The DebugOut Command
- Does not mess up your application screen
- Does not introduce extra window focus events to
your application
66Visual FoxPro and the Internet
- What is HTML?
- How does the Internet work?
- The Internet Search Wizard
- Accessing the search wizard page
- The Web Publishing Wizard
67Advanced Class Design Concepts
- Inheritance Hierarchy
- The is-a relationship
- Containership Hierarchy
- The has-a relationship
- Design Patterns
68Accessing the Windows API from Visual FoxPro
- What is the API?
- DECLARE command
- Calling an API function