(Updated: 2007.12.24 12:08:53 AM)
| |
Formally, from the
Dictionary of Object Technology (Prentice Hall
ISBN 0133738876
, SIGS Books
ISBN 1884842097
), it is:
n. any application-specific programming resulting in programs that consist of collections of collaborating objects, which have a unique identity, encapsulate properties and operations, communicate via message passing, any [sic?] are instances of classes related by inheritance, polymorphism, and dynamic binding. [Booch, Firesmith]"
Features of OOP:
Abstraction -- The ability to ignore the inner details and concentrate on the functionality exposed through the interface of the object.
Encapsulation -- The ability to group related pieces of information and processes into a self-contained unit. Encapsulation is implemented using:
- Objects with Properties and Methods. These are referred to with the following notation: Object.Property, Object.Method()
Polymorphism -- The ability to send the same message to items of different types and have each respond in its own way. Polymorphism is implemented using:
- Implementing Interfaces -- A class is defined formally as Implementing a specific Interface, which is a specific set of properties and methods. VFP7 now supports this method.
- Classes and Subclasses -- By having two differing subclasses of the same parent class (the parent class defines the interface), any subroutine that expects the parent class should be able to operate on either subclass.
- Ad-hoc Polymorphism -- In VFP, you can informally define an interface and implement it in unrelated classes, then hand any of these classes to a subroutine that requires the informally defined interface. This works in VFP because VFP is LooseTyped.
Inheritance -- The ability of an item to receive the characteristics of the item on which it was based. Inheritance is implemented using:
This is a great book that combines Object Oriented Programming with Visual FoxPro:
MarkusEgger (1999), Advanced Object Oriented Programmingwith Visual FoxPro 6.0, Hentzenwerke, Milwaukee, WI, ISBN 0965509389
.
Ivar Jacobson describes a good example of when object-orientation is/is-not a good approach. The example describes what types of solutions are/are-not suited for object-orientation. I found this example very useful to clarify what is object-oriented and what is not. Next time you are at the book store, pick up his book Object Oriented Software Engineering: A Use-Case driven approach ( ISBN 0201544350
) and take a look at pages 135-141.
-- Hector Correa
Links
See Also: OOp Terms, Microsoft Rants
Contributors Carl Karsten Cindy Winegarden
Category Definitions Category OOPrinciples Category Books - OOP