14 April 2016

Introduction to SharePoint 2013 App Model


Development options in SharePoint 2013

SharePoint Solutions (WSP)
  • Same as in SharePoint 2010 & earlier.
  • In SharePoint 2013, SharePoint solutions should be mainly used for creating customizations required for administrative functionalities for farm administrators.
Apps
  • New in SharePoint 2013
  • Apps should be used for creating customizations for end users.
Note – Sandboxed solutions have been deprecated in SharePoint 2013. They are however supported for backward compatibility


What is SharePoint App?

  • Stand-alone, self-contained piece of functionality.
  • Extends the features and capabilities of a SharePoint site.
  • Users can discover/download apps and then install them on their SharePoint site.
  • Apps can be uninstalled in an easy & clean manner.
  • Apps are available at – 
    • Public Store (SharePoint App store)
    • Corporate Store (Organization’s App catalog)
SharePoint Solutions Vs. Apps

SharePoint Solutions
SharePoint Apps
Code Model
Uses Server Object Model
Used Client side object model
Where code resides
Custom code resides on SharePoint server
Custom code resides outside SharePoint server
Where code executes
On the server within SharePoint execution environment
In a completely separate environment
(Browser or remote hosting environment)
Code Permissions
Same permissions as SharePoint environment
Limited permissions based on grant.
Deployment effort
More
Less
Recommended use
Customizations for administrative functionality
Customizations for generic functionality
Recommended usage by
Farm administrators
SharePoint end users


Features of SharePoint 2013 Apps

  • Can be installed, updated and uninstalled in easy manner.
  • As per SharePoint 2013 App model, custom server code will not be placed and executed on SharePoint server/farm. 
  • Custom code can be placed & executed at following locations – 
    • On client side (Browser)
    • On remote server (IIS/Window Azure) which is outside the SharePoint farm.
  • Uses following technologies to communicate with SharePoint Server
    • Client side object model (CSOM) 
    • Rest Services 
  • Authentication is done using OAuth.

Hosting options for Apps
  • SharePoint hosted apps
  • Cloud hosted apps
    • Provider hosted
    • Auto hosted
  • Combination of above

SharePoint hosted apps
  • All components of app are hosted on SharePoint farm (on-premise or Office 365).
  • App components are hosted in an isolated app domain of SharePoint farm.
  • This pattern is easiest to deploy.
  • App gets privileges of the signed-in user.
  • App can be developed in limited languages viz. HTML + JavaScript.
  • No server side code can be used in these types of apps 
  • SharePoint components can be accessed via JavaScript (using JSOM library) or REST APIs.

Provider Hosted Apps

  • App components are hosted outside SharePoint farm on any other web server/hosting service.
  • App gets authorized using OAuth or JavaScript cross domain library.
  • App can be developed in any language that is supported by outside web server/hosting service.
  • To interact with SharePoint followings options are available for app components - 
    • SharePoint client object model
    • JavaScript cross domain library
    • SP 2013 REST/OData based web service
Auto hosted apps
  • These are cloud hosted apps.
  • App components are provisioned and deployed on Windows Azure & SQL Azure.
  • App gets authorized using OAuth or JavaScript cross domain library.
  • App can be developed in any language that is supported by Windows Azure.
Hosting options - Comparison

SharePoint hosted Apps
Provider hosted Apps
Auto hosted Apps
App component hosting location
Isolated app domain of SharePoint farm
Any web server or hosting service
Windows azure & SQL azure
App authorization
Privileges of the signed in user
       OAuth
       JavaScript cross domain library
       OAuth
       JavaScript cross domain library
Supported Languages
HTML + JavaScript
Any language supported by web server/hosting service
Any language supported by Windows Azure web sites
Advantages
       Reusability of SharePoint items like lists, WebParts etc.
       Easy to create and deploy
       App can be hosted on any Microsoft/non-Microsoft hosting platform
       Supports many languages
       Resource provisioning, load balancing & other maintenance tasks are handled by Windows & SQL Azure infrastructure itself.
Disadvantages
       No server side code allowed.
       App only has authorization of signed-in user
       Remote components installation, upgrade and uninstallation is headache of developer.
       Only one hosting option available i.e. Windows & SQL Azure.
Good for
       Small apps
       Lower complexity apps
       Enterprise level apps
       Enterprise level apps

Authentication options in Apps
  • Authentication mechanism is dependent on where the app is hosted.
  • For SharePoint hosted apps, authentication is handled by SharePoint itself.
  • For Cloud hosted apps, following authentication option are available - 
    • Client side code along with cross site directory
    • Server side code along with OAuth.

App packaging and distribution
  • Apps are distributed as ‘App packages’.
  • App package may contain different components based on hosting option of App.
  • App Package installation Location –         
Hosting Type
Installation Location
SharePoint hosted app
SharePoint server
Provider hosted app
Remote server
Auto hosted app
Windows Azure cloud (Office 365)
App Licensing
  • An app license is a digital set of verifiable information stating usage rights of an app.
  • Usage right means – 
    • App is free or need to be purchased
    • App is available on per-user or site basis
    • App is a trial or full version
  • App license can be verified by querying Office store.
App permission management
  • Manage the ability of apps to 
    • Access and use internal SharePoint 2013 resources.
    • Perform tasks on behalf of users.
  • Determining minimum permission levels required for an app 
    • Read Only, Write, Manage or Full Control
  • Determining app authorization policy 
    • User & App Policy, App only Policy, User only policy
  • Determining app permission scopes
    • Site, Web, List etc.
Tools for developing SharePoint apps
  • Visual Studio 2012/13
    • For all types of SharePoint Apps
  • Napa (Office 365 development tool)
    • Can be used only for developing SharePoint hosted apps
  • Visual Studio LightSwitch
    • Can be used for both SharePoint hosted and Cloud hosted apps
How SharePoint 2013 App model changes customization methodology 

  • Apps should be developed for all customizations which are targeted towards end users.
  • SharePoint solutions should be developed only for administrative functionalities.
  • Sandboxed solutions should not be developed in SharePoint 2013. 
  • App development methodology will be dependent on your hosting option. 
  • Hosting option of 'Provider hosted apps' will be most suitable for enterprise level applications.

No comments: