After going through Introduction to Apps : A next generation of software applications, I think you are quite familiar about the Apps concepts in general. Lets move to our main business now - SharePoint Apps.
Apps in Sharepoint
Prior to SharePoint 2013, the most preferred way to develop a solution was to write server side code and deploy on the farm. Although there were other ways to develop solutions using Client Object Model or Sandbox, they were less intuitive to developers. The problem with these solutions are similar to problems of a traditional software we discussed here.
SharePoint 2013 Apps possess almost all of the characteristics of ideal Apps we discussed here.. SharePoint Apps are actually standalone, self-contained applications running on web that add to the capabilities of a SharePoint website ( Unlike MSDN, I avoid call them Web applications as this terminology is reserved for IIS virtual directory extended with SharePoint ) .
A SharePoint app has few or no dependencies on any other software on the device or platform where it is installed, other than what is built into the SharePoint platform. Hence, SharePoint Apps can be installed simply and uninstalled cleanly. In general, Apps can have no custom code that runs on the SharePoint servers (except the Apps which use SharePoint API). Instead, all business logic runs on the cloud or remote servers and the presentation logic on client computers\devices.
SharePoint App Hosting Model
A fully functional and feature-rich SharePoint App can contain many logical or physical components. These components can run on SharePoint or Remotely or both. For example, a weather APP can be a webpart that runs on SharePoint and consumes remote service to get the information about weather.SharePoint components that can be part of an App are list templates, modules, workflows, site pages, Web Parts, and custom content types. Remote components are external to the SharePoint farm like cloud-based services.
As we know , App can have SharePoint-based or External(remote or cloud-based) or both kind of components. Below are the hosting options based on the kind of components an App contains:
SharePoint Hosted: Apps that include only SharePoint components and client-side logic in HTML\Jquery can be hosted in SharePoint itself.
Cloud Hosted: The cloud based hosting is mainly for Apps (or Apps components) that are External to SharePoint Farm (like web services).The Cloud based hosting can be Provider-hosting and Auto-hosting :
- Provider-hosted: In this option, the Apps containing non-SharePoint components are deployed on an external server(not part of SharePoint farm) or Cloud. As a developer, you have to provide installation(and UN-installation) scripts and instructions.
- Auto-hosted: This option is for kind of Apps that uses resources and services from remote site hosted by Windows Azure and also interacts with SharePoint 2013 components(or websites). Auto-Hosted Apps include a Windows Azure Web Site, and possibly also a SQL Azure database, that are automatically provisioned when the App is installed.
Additionally, SharePoint Apps can be delivered via the SharePoint Store and the App Catalog.
SharePoint 2013 Apps Programming Model
With Apps, its now easy for any MS or non-MS( yes!) web developer to create standalone SharePoint solutions.
What can be developed and deployed as a SharePoint APP?
1) Application that need to use Sharepoint components or list data
SharePoint Apps can contain simple features like lists, web parts and leverage much advanced features like Search, workflow, social networking, taxonomy, user profiles, and Business Connectivity Services (BCS). Below is the complete list:
- Features (Web-scoped only)
- Custom actions (including shortcut menu items and ribbon customizations)*
- Remote event receivers*
- Markup that references Web Parts, including app parts, that are included in SharePoint (but not custom Web Parts)*
- Custom cascading style sheets (CSS) files for use by SharePoint pages
- Modules (sets of files)
- List templates
- List and library instances
- Custom list forms
- Custom list views
- Custom content types
- Fields (of field types that are built into SharePoint)
- Microsoft Business Connectivity Services (BCS) models (Web-scoped only), external content types based on the model, and external lists that use the content types*
- Property bags
- Web templates (but not site definitions)*
[Note: The above is an exhaustive list. So no other kind of SharePoint components can be deployed as an App.]
2) Application to surface external data\system
An app can surface any web based application that is supported by the host. The application can be based on ASP.NET , LAMP (Linux, Apache, MySQL, PHP). App can also surface data from remote DBs using BCS (Business Data Connectivity)
Note also that the model for apps for SharePoint supports external event handlers.
3) Office Integration
Apps can be used to integrate SharePoint data into an office application and vice-versa.
4) Applications that don’t require business logic to run on SharePoint server
In some cases, you may want to offload your business logic to a remote server instead of SharePoint server.
For example, An app to display weather information will have the business logic that don’t require SharePoint. This business logic can be exposed as a web service or web page which in turn can be consumed by App in SharePoint.