Object Hierarchy of WSS
WSS 3.0 Object model is divided into three hierarchies:
1) Physical Object Hierarchy
2) Content Hierarchy
3) Services Hierarchy
All object hierarchy contains classes and containers
Physical Object Hierarchy includes classes that represent Physical Entities such as Servers and files AND Containers of such entities such as Farms and Folders
Content Hierarchy includes classes that represent publishable items of data such as list items, and classes that represents nested containers of data such as lists, Content DB, websites, collections of websites, Web Applications
Service Hierarchy includes classes that represent services and instances
Physical Object Hierarchy: There are four major classes in this Hierarchy
SPFarm:
1) WSS 3.0 farm is represented by SPFarm class. Server farm is one or more WFE, Zero or more AS and SQL Server.
2) The SPFarm class represents a farm of one or more physical servers, so it is included in the Physical Hierarchy. But it can also be considered the top level of the Content Hierarchy; for example, all the (non-configuration) content of a Windows SharePoint Services farm can be backed up and restored.
3) SPFarm class can also be thought of as representing the configuration database that is associated with the farm because Windows SharePoint Services 3.0 has no class that represents the configuration database itself
4) SPFarm OBJECT has three classes: SPServer, SPService and SPSolution
5) SPFarm inherits from SPPersistedObject, which means that the object (there is only one) that instantiates the class persists in the configuration database.
6) SPFarm has static members for creating farms and returning references to the local farm or a remote farm.
7) SPFarm has many members that can be used for developing administration functionality.
Some of the more important members can help in the administration of the following:
· Backup and restoration of the farm
· Upgrades of the farm
· Migration of (moving) the farm
· Error reporting
· Caching
SPServer:
1) A physical server is represented by the SPServer class.
2) It has an Address property that holds the IP address of the server and a Role property that identifies the server's role in the farm
3) If there is just one server, its Role is SingleServer. If there is more than one, the front-end servers have the role WebFrontEnd an
4) d almost all other servers have the role Application
5) However, the Role property of a server that is physically hosting a Windows SharePoint Services content database typically has the value Invalid. This is because such servers typically run only one Windows SharePoint Services service—the Database Service (which is a Windows service)—and this database service is really just an alias for the SQL Server Windows service which is not part of Windows SharePoint Services. Hence, it is not really running any Windows SharePoint Services code, and it does not really fit into the Application role.
6) The SPServer class also has a ServiceInstances property that holds references to all the instances of Windows services and Web services that are running on the server
7) SPServer inherits from SPPersistedObject
SPFolder: Notice that the entity represented by an SPFolder object or an SPFile object might be located in a Windows SharePoint Services content database instead of in the file system of a server. For example, a spreadsheet file in a Windows SharePoint Services document library is stored in a cell of a database, not in a folder on one of the servers.
1) Represents a folder on a SharePoint Web site.
2) Various folder properties in the Microsoft.SharePoint namespace return a folder object; however, the GetFile method of the SPWeb class returns any folder from within a site or subsite.
3) Use the Folders property of the SPWeb class, or the SubFolders property of the SPFolder class, to return an SPFolderCollection object that represents the collection of folders for a site or folder. Use an indexer to return a single folder from the collection. For example, if the collection is assigned to a variable named collFolders, use collFolders[index] in C#, or collFolders(index) in Visual Basic, where index is either the index number of the folder in the collection or the display name of the folder.
SPFile:
1) SPFile Class represents a file in a SharePoint Web site that can be a Web Part Page, an item in a document library, or a file in a folder.
2) Use the GetFile or GetFileAsString method of the SPWeb class to return a single file object. Otherwise, use the Files property of either the SPWeb or SPFolder class to return an SPFileCollection object that represents the collection of files for a site or folder. Use an indexer to return a single file from the collection