Chapter 9. Classes and Objects: A Deeper Look


My object all sublime I shall achieve in time.

W. S. Gilbert

Is it a world to hide virtues in?

William Shakespeare,Twelfth Night

This above all: to thine own self be true.

William Shakespeare, Hamlet

Don't be "consistent," but be simply true.

Oliver Wendell Holmes, Jr.

Objectives

In this chapter you will learn:

  • What class scope is and how it affects access to class members.

  • To create overloaded constructors that can initialize objects of a class in a variety of ways.

  • To use partial classes to enable one class to span multiple source-code files.

  • How composition enables you to construct classes that are "made out of" other classes.

  • To use Me to refer to the current object's members.

  • How garbage collection eliminates most "memory leaks."

  • How Shared class variables help conserve memory.

  • How to create constant members with Const (at compile time) and ReadOnly (at runtime).

  • To use the Object Browser to discover the capabilities of the classes in the Framework Class Library (FCL).

Outline

9.1 Introduction

9.2 Time Class Case Study

9.3 Class Scope

9.4 Default and Parameterless Constructors

9.5 Time Class Case Study: Overloaded Constructors

9.6 Partial Classes

9.7 Composition

9.8 Using the Me Reference to Access the Current Object

9.9 Garbage Collection

9.10 Shared Class Members

9.11 Const and ReadOnly Members

9.12 Object Browser

9.13 Time Class Case Study: Creating Class Libraries

9.14 (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System

9.15 Wrap-Up



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

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