![]() Every object must have one and only one BaseClass. ![]() The key concept to remember here is that every item contained within the form will have its own BaseClass. Each item contained within the form will also have a BaseClass. ![]() If we look again at our form, the form itself has a BaseClass. This can get a little confusing when you look at objects that consist of or contain multiple objects. An object cannot exist without a BaseClass. The BaseClass is the starting place for all objects. Why is the BaseClass important? This is simple - all objects must have a BaseClass. That column will address this issue in more detail. Next month, I will be doing a column on To Framework or Not to Framework. If you write your programs without one or more intermediate classes, you have no place to put your unique variations on the base class.īy building a set of intermediate classes, you in effect build a Framework. The whole point of having classes is to create a hierarchy in which your personal coding standards can be stored. Do not base your applications directly on VFP base classes. A Collection is an object consisting of other objects.Ī word of warning is needed here. I put Collection in quotes because Collection itself is a VFP BaseClass. All together, this 'collection' of objects forms a new object that represents our form. The form may also have some compound object types like CommandGroup (2 or more command buttons) OptionGroup (2 or more option buttons). The form may have the following types of object TextBox, Label, CommandButton, EditBox, OptionButton, etc. VFP DEFINE CLASS SERIESIn the same way, program objects can be built by combining a series of other objects together. By the way, for those of you who do not recognize the term, Hydrocarbons are fuels - gasoline, diesel, etc. The key to differentiating the many types of Hydrocarbons is the quantity of Hydrogen and Carbon in each molecule as well as the order of the Hydrogen and Carbon Atoms. Simply put, these are molecules made up of Hydrogen and Carbon. Going back to our chemistry example, one of the more complex types of molecules is the group called Hydrocarbons. You create complex objects (molecules) by combining different types of base classes in different ways. In Chemistry terms, these are your atoms. The VFP Base Classes are a definition of all of the different types of primitive classes that can exist. These different types are defined by their BaseClass. Object types include such things as textbox, label, checkbox, custom, collection and many others. ![]() The object can consist of a single item, such as a text box, or the object can be a very complex collection of multiple objects of multiple types, such as a form.Įvery object in VFP will have a type. You can think of a molecule as being equivalent to a VFP Object. A molecule is an atom, such as He - Helium, or a collection of atoms such as H2O - Water. ![]() If you remember your High School Chemistry, the physical world can be viewed as a collection of Molecules. We will be going into more depth on objects later in this article. If you are confused right now, hang in there. An object is the basic building block for object oriented programming. VFP DEFINE CLASS CODEIt can be an item on a form, or the form itself, or the collection of all the items on a form, or it can be a piece of data, or code that exists independent of any visual image. I am attempting in this article, to make it easier to understand these concepts.īefore we go into Inheritance, Encapsulation and Polymorphism (IEP), we need to know what types of things IEP affects. These basic concepts of OOP are difficult to grasp. Yet, it took me 10 years from the time I first heard about Object Oriented Programming until I had an understanding of the meaning of Inheritance, Encapsulation and Polymorphism. VFP DEFINE CLASS PROFESSIONALI have been a professional programmer for over 30 year now. The article is oriented towards VFP, but the basic concepts apply to all Object Oriented Programming Languages. In this article I will address the basics of OOP - Object Oriented Programming. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |