Search code examples
.netsharepointsharepoint-2007sharepoint-2003

SharePoint API: 2003 vs 2007


I have coded a solution that uses the 2007 API to traverse the SharePoint object model. Now I need to support SP 2003 as well. What is the best way to do this?

Is it possible / recommended to use the 2007 api to get access to a 2003 SharePoint Farm?

If I use the 2007 API, do I have to use the deprecated classes to (for instance) reference a configuration database, or do I use the 2007 classes, such as SPFarm?

Or do I use the 2007 API for SP 2007 and the 2003 API for SP 2003...? Problem with this is that both use the same namespaces and class names. So it can get messy. (Except maybe if I use aliases to reference the different namespaces?)


Solution

  • As far I know the 2007 API and the 2003 API are incompatible. So yes? you will need to implement both.

    I can suggest to have interface ISharePointAPI and two implementations SharePoint2007API and SharePoint2003API. This implementations can even be packaged to different assemblies, so you will not have reference hell :). This is will also protect you from 2010 API changes as what you will need is to implement SharePoint2010API...