A few days ago Microsoft’s Office 365 Development Patterns & Practices team released the Office 365 Development Patterns and Practices. This consists of code samples that can be used to demonstrate custom solutions using the new App Model. This is another push from Microsoft to move away from Full Trust Code in SharePoint.

SharePoint has supported Full Trust Code since the beginning and it has several disadvantages including:

  • The code is deployed to the SharePoint servers.
  • The code is executed using the same process as SharePoint itself.
  • The code can easily degrade SharePoint performance.
  • The code can easily be a security concern since it truly has access to everything.
  • The code involves IT to deploy and maintain.
  • The code causes a lot of problems with it comes time to migrate or upgrade SharePoint.
  • The code is not supported (at all) in Office 365.

The advantages of the App Model include:

  • No code is deployed or executed on the SharePoint servers.
  • The code is isolated and only accesses SharePoint through APIs.
  • The code has its own security identity.
  • It requires little or no IT involvement (if they choose)
  • It works both on premise and in the cloud.
  • Using the App Model makes it is easier to migrate and upgrade SharePoint.

There are clearly advantages to moving to the App Model rather than using Full Trust Code for your SharePoint solutions. However, Full Trust Code has been around since the beginning of SharePoint and it’s not an easy transition. It is not a one-to-one conversion and Full Trust solutions need to be rethought and rebuilt in order to transition to the App Model. It also often requires a different developer skillset to implement.

This is where Office 365 Development Patterns and Practices helps. Since the release of the SharePoint App Model, it has been unclear as to what should be done using the App Model vs. using a Full Trust solution. For example, we often have custom event receivers, timer jobs and site provisioning solutions built using Full Trust solutions. When the SharePoint App Model was introduced, it didn’t seem that the App Model could handle these types of solutions. Yet, in most cases, the App Model can handle these solutions; it just requires some rethinking to make it happen.

Office 365 Development Patterns and Practices gives samples for these scenarios and many more. In fact, the focus has been to take common Full Trust solutions and show how they can be implemented using the App Model. It should be in every developer’s toolbox if they are serious about using the new SharePoint App Model.

Office 365 Development Patterns and Practices can be found on GitHub. It is open-source and it will be updated with contributions from both Microsoft and the community. You can make suggestions for future updates to the App Model through the Office User Voice site. If you have specific questions about the code samples, you can do so in the Patterns and Practices Yammer Group.