Section 10.1. Choosing an Approach


10.1. Choosing an Approach

The approach you choose depends mainly on the type of client you want to create. Table 10-1 shows a set of recommendations for programming different types of applications.

Table 10-1. Choosing an approach based on the type of client

Type of client

Use this approach

Office application (or an application that integrates with Office 2003)

Office object model

Windows application

Web services

Non-Windows application

Web services

ASP.NET application

Web services, URL commands, or RPC methods

SharePoint web part page

URL commands or RPC methods


The last item in the table doesn't look like a remote client since the page exists on the SharePoint server. However, URL commands and RPC methods are sent from the client browser via HTTP GET or POST. The commands or methods reside on the client browser and therefore can be considered remote programming. You'll learn more about that later.

There is overlap in each of the remote programming approaches, but only web services and RPC methods offer complete sets of features. To explain the recommendations a bit more, Table 10-2 summarizes the advantages and disadvantages of each approach.

Table 10-2. Comparing remote programming approaches

Approach

Advantage

Disadvantage

Office object model

Built in to Office 2003 Available from VBA or .NET Easy to use

Limited to Office- related objects Requires Office 2003

Web services

Provides complete set of objects Available on many platforms Built-in authentication

More complicated than Office object model Adds overhead

URL commands

Easiest to use Can run from a SharePoint page

Limited to getting data Data returned in XML (sometimes an advantage) Uses GUIDs to identify lists

RPC methods

Provides access to most SharePoint tasks (similar to web services) Lower overhead than web services Can run from a SharePoint page

Difficult to learn Data returned in XML (sometimes an advantage) Uses GUIDs to identify lists Requires FormDigest control for authentication


For most programmers, the decision is simple: use the programming technique you are most familiar with and look at the other approaches when you hit a wall. For instance, Office programmers can do a lot with the Office object model, but will need to add web services in order to add attachments to a list.



Essential SharePoint
Essential SharePoint 2007: A Practical Guide for Users, Administrators and Developers
ISBN: 0596514077
EAN: 2147483647
Year: 2005
Pages: 153
Authors: Jeff Webb

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