2014 SharePoint Saturday Melbourne Apps or not to Apps
1. SharePoint and Office 365 dev : to
apps or not to apps (v3)
Gold Sponsors Silver Sponsors Bronze Sponsors
#SPSMEL
2. SharePoint and Office 365 dev : to
apps or not to apps : v1
All is Apps, let’s go !!
#SPSMEL
3. SharePoint and Office 365 dev : to
apps or not to apps : v2
… well ! It depends …
#SPSMEL
4. SharePoint and Office 365 dev : to
apps or not to apps : v3
Where are we now ?
#SPSMEL
5. Who am I ?
Gilles Pommier
Office 365 MVP, MCT and co-founder of SmartView
http://www.smartview.fr
gilles.pommier@smartview.fr
SmartView
Agile
SharePoint/Office 365
Coaching/Training
21. Evolution of SharePoint Development Solutions
2007
IIS
SharePoint
Code runs from GAC on
same w3wp.exe as
SharePoint web application
2010
IIS Sandbox
SharePoint
Code runs on
SPUCWorkerProcess.exe
or calls client.svc (CSOM)
-No code solution-
2013
IIS with _api App
SharePoint
Code runs outside of SharePoint
but has trust to leverage
capabilities exposed in _api
22. Evolution of customizations in SharePoint
SP2007 SP2010 SP2013
Declar. App &
Workflow Events
CSOM
_vti_bin _vti_bin
_api
_api
25. Office 365 Development Environments
Developer Site
Napa Office 365 Development
Tools
SharePoint-hosted App Provider-hosted App
Visual Studio
Office Developer Tools
SharePoint Client Components
26. App isolation: App web vs Host web
Apps live in their own isolated environment called the “app web”.
The site in which they function is called the “host web”
APP1UID GUIDAPP1
27. SharePoint app hosting
Get remote events from SharePoint
Use CSOM/REST + OAuth
Provider-hosted App
Bring your own server
hosting infrastructure
Autohosted App
Windows Azure + SQL Azure
provisioned automatically
as apps are installed
SharePoint
Web
Your Hosted
Site
including Azure
SharePoint
Web
Azure lite
SharePoint-Hosted App
Reuse web elements (lists, out-of-box web
parts). Client side technologies and
declarative workflows. No server-side code.
Host
web
App Web
(from WSP)
Cloud-hosted Apps
28. Be careful …
Autohosted Apps Preview program has ended– 05/16/2014
http://blogs.office.com/2014/05/16/update-on-autohosted-apps-preview-program/
33. Differences between C# and JavaScript
C# JavaScript
using Microsoft.SharePoint.Client; ExecuteOrDelayUntilScriptLoaded(initFunc, “sp.js”);
…or…
$(document).ready(initFunc);
using (ClientContext context = new
ClientContext(absoluteUrl))
using (ClientContext context = TokenHelper…( ))
var context = SP.ClientContext.get_current();
var context = new SP.ClientContext(relativeUrl);
string title = web.Title; var title = web.get_title();
context.Load(oList, list=>list.Title, list=>list.Created); context.load(oList, ‘Title’, ‘Id’);
context.load(oListColl, ‘Include(Title, Id)’);
context.ExecuteQuery();
context.ExecuteQueryAsync();
context.executeQueryAsync(onSuccess, onError);
Value types: StringCollection Value types: string[], NaN
Automatic FormDigest handling Manual FormDigest handling
Issues creating RoleDefinitionBindingCollection’s
35. Apps (.App) vs solution packages (WSP)
Apps Sandboxed WSP No
Code (*)
Full trust WSP
(on prem only)
Where does server-side code run?
Anywhere but
farm
Farm (User Code
Service)
Farm (w3wp.exe)
Scalable Highly Limited Based on farm
Who installs and removes Users Site collection admin Farm admin
Supported in SP2013 Yes Yes Yes
SharePoint Online compatible Yes Yes No
Azure-hosting compatible Yes No No
Requires local farm for developers No Yes Yes
Remote deployment and debugging from
Visual Studio
Yes No No
37. When to use the new SP2013 App Model?
When your SharePoint customizations use:
Full screen interfaces (SPA)
App Parts
Workflows and Remote Event Receivers
Data from other systems
Custom Ribbon/Menu Actions
Custom Lists/Fields/Views/etc
Capabilities offered by your host of choice
38. When NOT to Use the New SP2013 App
Model
Just some examples:
39. Gray Areas
= Things that you can do in an app for SharePoint, but
perhaps there are:
limitations
or
alternative ways to do it
40. Branding
Recommended
to evaluate this!
All three of these are still traditional ways to
change look and feel of SharePoint
Maybe… through
event receivers,
PowerShell, and more
wsp
42. Demo : Branding with Apps
http://www.youtube.com/watch?v=wtQKjsjs55I)
43. Timer Jobs
Not directly supported in an app for SharePoint
Alternatives:
1) New Windows Azure WebJob feature
2) Console App
3) Farm Solution (on premises only)
44. External data
BCS supports only OData connections in the App Model
Alternatives:
1) Create your own OData wrapper outside of the
app for SharePoint
2) Write code instead of using BCS
45. “To App or Not To App” ?
It is the recommended approach for development for
SP2013 and beyond!
46. “To App or Not To App” (Decision Matrix)
1) Out of box SP capabilities?
2) App already exists?
3) Lite customization tools?
4) App Model? (with Azure,…)
5) Only as a last resort – farm/sandbox solution?
54. New SharePoint remote APIs
New SharePoint client components redists
Updated client components for SharePoint server 2013 SP1
New client components for SharePoint online
Both include portable libraries for use in Windows Store apps
New APIs available in Office 365 and on-premises
Site collection management
Specify content type IDs
AlternateCssUrl
SiteLogoUrl
and More
Site provisioning and branding solution pack
56. Further reading
Andrew Connell : My thoughts on the SharePoint App Model, Office
365, SharePoint Store and the Business of SharePoint Apps Today
Doug Ware : The SharePoint 2013 App Model is better than Farm
Bjørn Furuknap : SharePoint 2013 App Model – The Jury is Back
Jeremy Thake : Migrating Solution Packages to SharePoint 2013
Apps…really?
Chris O'Brien : SP2013 host web apps: provisioning files (e.g. master
pages) to the host web
57. Takeaway
Futur of development model for SharePoint and O365 is Apps
SharePoint developer is changing to become Web Developer
(javascript/jquery/html)
Use apps whenever it’s possible
Some developement cannot be done with apps, but there are
alternative solutions
YES, you can do AngularJS with SP Farm WebPart
Farms & SandBox solutions are still used … for now
60. Deployment
Model Office 365 Permissions On-Prem Permissions
SharePoint
Sandbox YES YES
Full Trust NO YES
SharePoint Hosted YES OAuth via ACS YES High-Trust (S2S)
Remote
Provider Hosted
• Developer hosts
app
• Could be in Azure
YES OAuth via ACS YES High-Trust (S2S)
Auto-Hosted
• App can deploy
website and SQL
Azure db
• Hosted in Office
365 Azure Cloud
YES OAuth via ACS NO
61. Compare customization models
Full trust WSP Sandboxed WSP Apps
Where does server-side code run? Farm (w3wp.exe)
Farm (User Code
Service)
Anywhere but farm
Scalable Based on farm Limited Highly
Who installs and removes Farm admin Site collection admin Users
Supported in SP2013 Yes Yes Yes
SharePoint Online compatible No Yes Yes
Auto-hosting compatible No No Yes
Requires local farm for developers Yes Yes No
Remote deployment and
No No Yes
debugging from Visual Studio
62. Hosting Comparison
SharePoint Hosted Cloud Hosted
App Scope SharePoint Site Site or Tenancy
Architecture Web Site Can be Multi-Tenant
App
Developer Skillset SharePoint +
HTML/JS
Full Stack
UI Technologies SharePoint +
HTML/JS
Any Web Stack
Server Code None Any
Storage Lists and Libraries Any
Key Limitations No Server Code Hosting Expertise
Required
Good for… Smaller apps &
resource storage
Any type of
Application
Notes de l'éditeur
Can have multiple user experiences within an app
APP1UID : unique ID given to each app installation in tenancy – makes each app domain unique
GUIDAPP1: Name of the SPWeb under which the app is installed – allows devs to plugin
The way I look at it is that I can do just about everything I need to do using the CSOM within a specific site collection.
The REST interface on the other hand is mostly brand new in the SharePoint 2013 release. There was a single service in SharePoint 2010 that we could use that enabled read/write to data within a list. The current REST implementation covers a huge area of SharePoint 2013.
Rob Windsor Pluralsight course