1. Technology
Objects! (and Methods and Properties)
3 - So What Are Methods and Properties?
Lesson 2
Objects!

1 - The Word VBA Macro Reconsidered

2 - The Nature of OOP

3 - So What Are Methods and Properties?

4 - The Word Object Model

5 - Objects in General


To get a handle on these the two terms method and property, lets consider some phrases from the definitions quoted in the previous section:

"data and procedures" (used by www.webopedia.com)
"methods, which operate on the data" (used by www.hyperdictionary.com)
"a state, and a behaviour" (used by www.wikipedia.org)

If you think about them carefully, you will see that these definitions say the same thing, but they use different words to say it. I said that an object is just a program. Let's look at the statement in the Word VBA macro:

Selection.TypeText Text:="Hello World."

Notice that this statement does something and it contains information.

What the statement does is a method. TypeText is the name of that method. The information in the statement is a property. Text is the name of the property.

In fact, the only parts of the statement that are not objects, methods, or properties are the Visual Basic symbols and operators:

' . ' - The 'dot' operator
' := ' - The named parameter symbol
' " ' - The string delimiter symbol

In the past, people have thought of a program as just a logical procedure that takes input data, processes it, and produces output data. They thought that the job of the programmer was to know how to write that programming logic. Object Oriented Programming is just a newer way to think about the job of the programmer. The job is now to understand the objects used to change information rather than the logic. Most of the logic is usually inside the objects anyway. In other words, the logic is part of the object methods.

But how do you figure out what all these objects, methods and properties are? Let's look at one way when we consider:

4 - The Word Object Model

©2014 About.com. All rights reserved.