Chapter Summary

 < Free Open Study > 



This first chapter was a whirlwind review of the cornerstones of classic object technology: encapsulation, inheritance, and polymorphism. Encapsulation allows us to scope the visibility of a class definition using the public, private, and protected keywords. Private data may be set and retrieved safely using public accessors and mutators, which enforce data safety.

Inheritance comes in two flavors: classical inheritance (Is-A) and the containment/delegation model (Has-A). In either case, we are able to compose new classes based on existing ones. Closely related to inheritance is polymorphism. Polymorphism allows our objects to act as individuals in a system, responding in their own way to the same message. If an OOL supports classical inheritance, we may make use of either classical or ad hoc polymorphism. If the OOL in question does not support classical inheritance, we are stuck with ad hoc polymorphism, containment, and delegation.

Finally, we reviewed the use of C++ templates. Templates provide a way to create a generic shell operating on "some type." This approach to class design provides another form of source code reuse and allows developers to create classes that are not fully specified until the object is created and specified by the calling syntax. As we will see beginning in Chapter 6, ATL makes substantial use of templates to help minimize redundant and boilerplate COM code.



 < Free Open Study > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net