Hi All
Here are the notes of last week's Beginning VFP 5.0. I haven't the means
here to attach the PowerPoint presentation itself. Hopefully, I'll be able
to add
to these notes next month. Meanwhile, comments? Anyone interested?
VFP 5.0 - Beginning Considerations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Property: Attributes or characteristics of an object
Can be Public or Private
Event: Recognition of interactive/programmatic stimulus
by an object
Events are pre-defined in VFP
Examples:
Click KeyPress
Error Init
Destroy
Method: Default and/or program logic invoked as a
response to an event
Public or Private
All events have methods
Not every method has an event
Examples:
Click() has an event
Unload() has an event
Save() has no event
Class: Collection of PEMs. (Properties, Events & Methods)
Blueprint for object creation
VFP has 28 base/foundation classes
They are either Container or Control classes
Can be extended by adding PEMs
User defined classes can be stored in one or more
class libraries (.VCX)
Base classes may not be altered -- subclass
them first
Object: Instance of a class
Inherits PEMs from its parent class
Can be extended by adding PEMs
Abstraction: Process of reducing a complex concept into a
collection of simpler, more easily
understood elements
Comparable examples:
Manufacturing sub-assemblies
Legal doctrines
Accounting principles
TextBoxes, Command Buttons, etc.
Encapsulation: Calls for an object to include all of the data
nd
logic necessary to manage itself
Tell the object WHAT to do, not HOW to do it
ThisForm.Save()
Never directly manipulate another object's PEMs
-
instruct it to manipulate its own
Use the "I'm alive" principle. That is, I
know my own PEMs and I can manipulate them
myself.
Polymorphism: Objects from different classes can respond to the
same stimulus in different ways
Command Buttons and CheckBoxes each have a
Click() event, but behave differently when that
that event occurs. Greek:
Poly - many
Morphus - form
Inheritance: The idea that a new class (subclass) can be
derived
from an existing class (parent class) and
inherit the properties, events, and methods from
that class
Subclass can add or override PEMs
Hierarchical persistence: if you change a
property, say, in the parent class -- it is
changed in the children of that class
Primary Maintainable
Advantages: Reusable
Reliable
Several ways to create:
with code: MyObject = CREATEOBJECT( Classname [,
eParameter1, eParameter2,...])
or using any of the following:
Visual Designers
Form Designers
Property Sheets
Color Palette
Form Controls ToolBar
Layout Designer Palette
Getting 1 - Subclass VFP base classes first CREATE CLASSLIB
Started: 2 - Create an application directory
3 - Set VFP Options | File Locations
4 - Create a new project
5 - Add data tables to project (from old 2.6)
6 - Add/Modify Tables and Indices (from old 2.6)
---------------------------------------------------------------------------
Next month, we're converting the old Laser project which came with 2.6 to
Visual FoxPro 5.0 -- with several enhancements. Let me know if you're
interested. I'll post the notes here, if so.
David in Dallas.
--- Maximus/2 3.01
---------------
* Origin: * MacSavvy OS/2 BBS * Dallas, Texas * 972-250-4479 * (1:124/1208)
|