Understanding Objects, Properties and Methods

As I said in the first post of the series, we will be using PowerShell to interact with SharePoint object model, so we do need to spend a few minutes talking about the differences between an object, a property and a method.

In simple terms, a method can be thought of as a subroutine or a function. Many objects in the SharePoint object model have "precanned" methods attached to them, we'll come back to this in a later post in more detail.

An object is an element within the object model. Objects are comprised of one or more objects and/or properties. I have always found it useful to conceptually relate objects and properties to XML—objects would be nodes of your XML, and properties would be individual attributes on your nodes. If you were to apply this concept to the photo below:

  • The house is an object
  • The color of the house (blue) could be a property of the house
  • The number of windows (3) could be a property of the house
  • The door could be an object of the house
  • The color of the door (blue) could be a property of the door