The object defines its interface.
These are words to live by. Classes initially built for Access applications were moved to
VB 6 with little or no modification (and the reverse is also true). The same is true of bringing
those classes into Excel applications. Of course, the .NET world with its new syntax changes
that, but the concepts still apply (which helps to make a more effective transition to the .NET
environment). That said, the classes provided in this book should work in almost any Microsoft
Office environment (prerequisites and differences in component or Office versions notwithstanding).
That??™s the beauty of using class-based code. Objects are defined as an instance
of a class. Objects have properties (nouns) and methods (verbs), and can fire events. Each
object instance holds its own values for its properties (private instance variables). Objects are
responsible for providing a certain behavior (or functionality), and they can collaborate with
other objects to performtheir tasks. Classes hide their inner workings so we can simply bring
an existing class into a project and begin using the functionality it provides. This is known as
encapsulation, and is one of the fundamental concepts of OOP. A FileReader class may have
the ability to open and parse an XML file and return various nodes to me through its interface.
I do not need to concern myself with the details of how it accomplishes this. I call the GetNodes
method and I??™ve got the nodes I need to work with.
Pages:
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66