Hour 17. Designing Objects Using Classes

   

Hour 17. Designing Objects Using Classes

You learned about what makes an object an object in Hour 3, "Understanding Objects and Collections." Since that hour, you've learned how to manipulate objects such as forms and controls. The real power of leveraging objects comes from being able to design and implement custom objects of your own design. In this hour, you'll learn how to create your own objects by using classes (in contrast to using static methods). You'll learn how to define the template for an object and how to create your own custom properties and methods .

The highlights of this hour include the following:

  • Encapsulating data and code using classes

  • Comparing instance member classes with static member classes

  • Constructors and destructors

  • Creating an object interface

  • Exposing object attributes as properties

  • Exposing methods

  • Instantiating objects from classes

  • Binding an object reference to a variable

  • Understanding object lifetime

  • Releasing object references


graphics/bookpencil.gif

There is simply no way to become an expert on programming classes in a single hour. However, when you've finished with this hour, you'll have a working knowledge of creating classes and deriving custom objects from those classes; consider this hour a primer on object-oriented programming. I strongly encourage you to seek other texts that focus on object-oriented programming after you feel comfortable with the material presented throughout this book.


   
Top


Sams Teach Yourself C# in 24 Hours
Sams Teach Yourself Visual Basic 2010 in 24 Hours Complete Starter Kit (Sams Teach Yourself -- Hours)
ISBN: 0672331136
EAN: 2147483647
Year: 2002
Pages: 253
Authors: James Foxall

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