SlideShare a Scribd company logo
1 of 33
Where to save my data, for devs! 
Benjamin J. Steinhauser 
NJ SPS 2014 
1
About Me 
• Benjamin J. Steinhauser 
• SharePoint Solution Architect 
• B&R Business Solutions 
• BS/MS in CS; MCP, MCTS (SP2010 Config. & Dev.) 
• 12+ years as ASP.NET Application Developer 
• 7+ years as SharePoint Developer 
• Creator of Open Source CodePlex Projects: 
• SPCAMLQueryHelper (over 45,000 downloads) 
• SPFileZilla (over 1,600 downloads) 
• SPMMDNavigator (over 1,800 downloads) 
• SharePoint 2010 and 2013 Custom Claims Authentication with Twitter 
• SharePoint 2010 Claims FBA Examples with OpenID 
• Author of paid products: SharePoint Metro Grid Web Part, SharePoint Swipe 
Gallery Web Part 
• Presenter at SP User Groups and SharePoint Saturday Events 
2
Intro 
• Where do I store my application’s data? 
• Developers have many choices when building solutions that 
consume data in SharePoint, what are best practices? 
• Who: is the consumer of the data? 
• What: is the type of data being saved? 
• When: is the data needed, and for how 
long should it persist? 
• Why: is the data being stored in the first place!? 
• Where: is the data being stored? 
3
Consider… 
• What are the advantages/disadvantages for each option? 
• What are the restrictions? 
• What type of data is it? 
• Settings, configuration, licensing 
• Structured data (employees, favorites, HR forms, etc.) 
• How long should the data persist? 
• Who is the data consumer? 
• End user, Power User, Administrator 
• Web Part, Application Page, Timer Job, Web Service, Service 
Application 
• Is the data sensitive? Does it require encryption? 
• Is Performance a factor? (always consider caching) 
4
Where is my data!? 
1. Database 
2. SharePoint List 
3. SP Secure Store 
4. Property Bags 
5. Web Part Properties 
6. Web.config 
7. SPPersistedObject 
5
1. Databases 
• MS SQL Server, Oracle, MySQL 
• CRUD: create, read, update, delete 
• For structured data, relational data 
• Easy (if you know SQL), very fast 
• Ways to interact: 
• LINQ to SQL 
• LINQ to Entity 
• Stored Procedures 
• Inline-SQL in .NET 
• But… 
• Farm solutions only (not for Sandbox Solutions) 
• Database needs to be created (database administrator) 
• Permissions need to be configured (database administrator) 
• Contexts need to be built (when using LINQ) 
• Another actual “layer” to manage 
• Connections strings need to be saved (more data!) 
• “Put it in a list, duh!”, not so fast, does it need the SP overhead? 
• Better for custom business applications that store lots of data, specialized data, 
data that doesn’t need to be accessible via a List, Searched. 
6
2. SharePoint List 
• ECM: Site Columns, Content Types, Custom Lists 
• BCS External Lists too! Combine database, enterprise data with SP 
• Provisioning: Create on Feature Activation, packaged in WSP 
• Site level (root web), Web level (each web site) 
• Accessible to Normal Users, Power Users, and Admins 
• Sandbox Solutions supported 
• Many ways to interact: 
• SharePoint Object Model (c#, vb.net) 
• LINQ to SharePoint (SPMETAL) (c#, vb.net) 
• SPQuery (with CAML) 
• SPSiteDataQuery: cross site list queries 
• SP Client Object Model: from JS, Silverlight, .NET (no anon access) 
• REST (listdata.svc, _api) (no anon access) 
• ASMX SOAP Web Services: deprecated 
• CodePlex SPServices: uses the soap web services, but yes anon access! 
7
Cont’d 
• For saving settings, existing implementations: 
• My Custom Config List 
• ***Codeplex: http://spconfigstore.codeplex.com 
• SharePoint Enterprise Patterns and Practices 
8
Cont’d 
• Pros: 
• User Interface: Standard user interface: New, Display and Edit forms 
• Change Management: Support for change management (simple one-step approvals, full workflows) 
• Alerts: Users can be alerted when settings are changed 
• Versioning: Versioning and the ability to roll back changes to a previous value 
• Auditing: Determine who made changes and when they were made 
• Security: Security trimming and the ability to set security as granular as a specific list item 
• Backup/Restore: Taken care of already as part of your normal content database disaster recovery 
operations 
• Recycle Bin: Ability to take advantage of the Recycle Bin 
• Scope: Granularity can be achieved by using multiple settings lists at different levels (ex. in Central 
Administration for items scoped to a server farm or Web application, in the root Web site of a site 
collection for items scoped for the site collection, in any site for items scoped to the site itself 
• Cons: 
• Performance: Implications if settings are used repeatedly in a high volume environment (use cache!) 
• Limitation on the types of values: Lists can only store simple values, strings, numbers, etc. They 
cannot store objects. Even storing serialized objects significantly limits their usefulness because it 
means that the standard forms are largely useless. 
• Settings removal: Potential for orphaned settings if a piece of functionality is removed but the 
corresponding setting SPListItem does not get properly cleaned up. 
• List deletion: Serious problems if the settings list is deleted. (fixes: proper security, hidden lists) 9
DEMO: Config List Reader 
• Custom List created in Feature Activation 
• Filled with default data 
• Custom Class: ConfigListHelper 
• CreateConfigList() 
• GetAllValsElev() 
• GetAllVals() 
• Custom application page: 
• Reads all config data into Hashtable 
• Displays to page 
10
BONUS: LINQ to SP 
• Enables you to use Language Integrated Query (LINQ) queries 
• Translates LINQ queries into Collaborative Application Markup Language 
(CAML) queries. 
• Sandbox Solutions supported 
• Steps: 
• Generate Entity Classes (using SPMETAL.exe) 
• Write LINQ queries in C# or VB.NET 
• Run solution 
• Pros: 
• No more CAML! Natural Language syntax, or Expression syntax 
• Cons: 
• Need to build context 
• SPMETAL.exe by default builds entity classes for ALL lists, content types, etc. 
• Can customize this with xml parameters file, see MSDN 
• Chicken and Egg problem: must create a list and deploy to run SPMETAL to 
build the context on it. 
11
DEMO: LINQ to SP 
• Feature Activation, Event Receiver: 
• Create List, “Best SharePoint Blog Sites” 
• Fill with sample data 
• SPMETAL BAT file, creates Entity context 
• SPSVB2014Linq.cs 
• Custom Application Page: 
• Display ListItems 
• Add a ListItem 
12
3. Secure Store 
• Secure Store Service provides a way to map credentials and delegate access to 
remote resources. 
• The Secure Store Service integrates seamlessly with Business Connectivity Services 
(BCS). 
• Features an API that can be taken advantage of within custom development projects. 
• Makes it an attractive option for storing configuration data. 
• The Secure Store Service allows us to create Target Applications which house sets of 
credentials. 
• The two main types are Individual and Group applications: 
• Individual: credentials are mapped to individual users 
• Group: all users share the same set of credentials. 
• Required Assemblies: 
• Microsoft.BusinessData.dll 
• Microsoft.Office.SecureStoreService.dll (GAC) 
• Not available from SPCOM (JSOM), not sure about Sandbox Solutions. 
• Read permissions required, either explicit or through elevation/impersonation 
13
DEMO: Configure Secure Store 
14
DEMO: Using Secure Store 
• Custom Class 
• SecureStoreHelper.GetCredentialsFromSecureStoreService(applicationId) 
• applicationId: string (ex. “SqlServerTest”) 
• Custom Application Page 
• Get saved settings from Secure Store 
• Using “Application Id” 
18
4. Property Bags 
• Hashtable/Dictionary collections to store simple objects (string, int) 
• Can use Serialization to save custom objects, Lists, collections, etc. 
• PropertyBags are available here (everywhere!): 
• SPContentDatabase 
• SPFarm: Farm admins only; no Sandbox; WFE read-only(?) 
• TimerJob: Each timer job has its own bag; Farm admins only; no Sandbox 
• SPServer 
• SPWebApplication: Each web app has its own bag; Farm admins only; no 
Sandbox; WFE read-only(?) 
• Site Collection (SPSite.RootWeb): Using root web, web admin to edit; root 
web read access to read; Sandbox supported 
• SPWeb: Web admin to edit; web read access to read; Sandbox supported 
• List (SPFolder): via root folder, List owner to edit; list read access to read; 
Sandbox supported 
• SPListItem 
• SPFile 
19
Cont’d 
• Pros: 
• Easy to use (native SP functionality in SOM) 
• Scope: very granular because they are per-object 
• Backup/Restore: taken care of as part of your content database recovery 
operations 
• Management: properties are stored and managed with their relevant object 
(backing up web site saves its property bag, deleting a web site deletes its 
property bag) 
• Cons: 
• Availability: certain key objects do not support a property bag (ex. SPUser), 
although there are workarounds 
• No advanced capabilities to review, approve, audit, rollback changes 
• Difficult to store variations: can be difficult to store variations of a single 
setting, per-locale, per-user 
• Not meant for large data, approx. 4-8 KB and below 
• No interface to CRUD, build your own, or use a plugin (codeplex), or 
SPDesigner, SP Manager (2010, 2013) 
• http://pbs2010.codeplex.com, http://pbs2013.codeplex.com 20
DEMO: Property Bags 
• Custom Class: PropBagHelper.SiteRootWeb 
• SafePropBagSave(site, key, value) 
• SafePropBagRead(site, key) 
• SafePropBagRead(site) 
• Custom Application Page: 
• Get all root web keys 
• Save a key 
21
BONUS: Serialization 
• Serialization: converting an object into a stream of bytes, to store or 
send the object 
• Its main purpose is to save the state of an object in order to be able 
to recreate it when needed (hydrating). 
• The reverse process is called Deserialization. 
• We convert bytes to strings, to save in Property Bags, ViewState, 
cache, etc. 
• Popular Formats: 
• XML Serialization 
• SOAP Serialization: 
Conform to the SOAP specification. SOAP is a protocol based on XML, designed specifically to 
transport procedure calls using XML 
• JSON Serialization 
• Tools/API: 
• NewtonSoft’s Json.NET 
• My API 22
DEMO: Serialization 
• Custom Classes: 
• JsonExtensionMethod 
• XmlSerialization 
• Custom application page: 
• Local class: Person 
• On page load, Person created, Serialized to text, 
displayed in textboxes 
• Button to Deserialize, fill Person Objects, display IDs 
23
5. Web Part Properties 
• The Web Part base class contains a set of properties that users can use to control its 
appearance and behavior (width, height) 
• A custom property is a property that you create when you need additional properties 
to enhance your Web Part's functionality 
• The custom properties you create and specify as able to be browsed are displayed 
automatically in the default property pane 
• If the default property pane isn't rich enough in functionality, you can create a 
custom user interface called a tool part to manipulate your custom properties 
• Available in Sandbox Solutions 
• Available in Standard and Visual Web Parts 
• Easy to update in custom tool pane Class, tricky to update in regular Web Part page 
lifecycle events 
• SetPersonalizationDirty() 
• ***Checkout required, Content Approval, Publishing 
24
DEMO: Web Part Properties 
• Web Part Feature 
• Add to page 
• Read web part property value 
• Update web part property value 
• Show in default properties pane 
• Change settings, require checkout. 
25
6. Web.config 
• Usually the first place ASP.NET Developers look 
• We quickly find out that it’s a double edged sword 
• Pros: 
• Find file, open, add key/value pair, save … profit! 
• 1 LOC to access data from app 
• Cons: 
• Farm solutions only (not for Sandbox Solutions) 
• Have to update every WFE separately 
• SPWebConfigModification should be used, which may “nuke” your 
custom settings added manually, or “nuke” other manually entered 
settings 
• Need server access, admins only 
• Either don’t use this, or use this for farm-wide settings that “need” 
to be secured in web.config 
• Better yet, use a nested web.config in your applications layouts 
folder (saved in HIVE instead of INETPUT) 26
DEMO: Web.config 
• Nested Web.config file in app “_layouts/<appname>” 
• Custom Class: WebConfigHelper 
• Designed to use modes, makes it easy to store different 
environments together (ex. dev, test, staging, prod) 
• GetMode(): get the current mode 
• GetKey(): get the key associated with the current mode 
• Custom application page: 
• Retrieves single property and displays 
27
7. SPPersistedObject 
• For storing settings at the Farm and Web Application level 
• “There is no functional difference between the hierarchical object 
storage and a property bag that is scoped at the SPFarm level, so 
deciding which to choose is largely a matter of preference.” 
• For storing multiple settings and more complex values 
• Create a class that inherits SPPersistedObject 
• Add your settings as properties 
• Mark them as Persisted (with attribute) 
• Then use SPFarm.GetChild or SPWebApplication.GetChild 
• Settings saved in SP Config DB 
• Cons: 
• Requires Farm Admin to save settings 
• Farm solutions only (not for Sandbox Solutions) 
• There is no built in user interface to manage SPPersistedObjects 
• Must impersonate Farm admin to read and write, since access to 
Config database required (RunWithElevatedPrivs doesn’t help) 
28
Bonus: 
• Session State: not available by default in SP 
• ViewState/Hidden Text Fields: use serialization, page level 
• Cache: HTTPRuntime cache, AppPool level, watch out for load 
balancing, great for caching expensive SPList/DB queries 
• Cookies: use jQuery Cookie plugin 
• HTML5 Web Storage: great for SPAs 
• Window.localStorage, code.sessionStorage 
29
Questions? 
30
Thanks! 
• FREE GIVE AWAY, $100 value! 
• SharePoint Metro Grid Web Part, 
or, SharePoint Swipe Gallery Web Part 
• For SharePoint 2010, 2013 (on prem. & cloud) 
• Free download, 30 day trial, email me for free license* 
• http://www.amrein.com/apps/page.asp?Q=5827 
• http://www.amrein.com/apps/page.asp?Q=5853 
• Email: bsteinhauser@bandrsolutions.com 
• Presentation and Code: http://1drv.ms/1o7sZvu 
* Product licensed per front-end server, offer is for 1 free license for 1 front-end server. 
33 
Take a picture of this slide!

More Related Content

What's hot

SilverStripe From a Developer's Perspective
SilverStripe From a Developer's PerspectiveSilverStripe From a Developer's Perspective
SilverStripe From a Developer's Perspectiveajshort
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Lucidworks
 
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...MediaMongrels Ltd
 
SQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowSQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowQuest
 
Big SQL 3.0 - Toronto Meetup -- May 2014
Big SQL 3.0 - Toronto Meetup -- May 2014Big SQL 3.0 - Toronto Meetup -- May 2014
Big SQL 3.0 - Toronto Meetup -- May 2014Nicolas Morales
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )Rajput Rajnish
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patternsAlex Theedom
 
Oracle Autonomous Database for Developers
Oracle Autonomous Database for DevelopersOracle Autonomous Database for Developers
Oracle Autonomous Database for DevelopersTércio Costa
 
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganKoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganTobias Koprowski
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewBrett Meyer
 
Making sense of Microsoft Identities in a Hybrid world
Making sense of Microsoft Identities in a Hybrid worldMaking sense of Microsoft Identities in a Hybrid world
Making sense of Microsoft Identities in a Hybrid worldJason Himmelstein
 
Databases & Microsoft SQL Server
Databases & Microsoft SQL ServerDatabases & Microsoft SQL Server
Databases & Microsoft SQL ServerMahmoud Abdallah
 
Extjs3.4 Migration Notes
Extjs3.4 Migration NotesExtjs3.4 Migration Notes
Extjs3.4 Migration NotesSimoAmi
 
Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...
Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...
Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...Tobias Koprowski
 
Hibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesHibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesBrett Meyer
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects OptimizationWO Community
 

What's hot (20)

SilverStripe From a Developer's Perspective
SilverStripe From a Developer's PerspectiveSilverStripe From a Developer's Perspective
SilverStripe From a Developer's Perspective
 
DAC 2012
DAC 2012DAC 2012
DAC 2012
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
Ow
OwOw
Ow
 
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
Efficient working with Databases in LabVIEW - Sam Sharp (MediaMongrels Ltd) -...
 
SQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To KnowSQL Server 2017 Enhancements You Need To Know
SQL Server 2017 Enhancements You Need To Know
 
Big SQL 3.0 - Toronto Meetup -- May 2014
Big SQL 3.0 - Toronto Meetup -- May 2014Big SQL 3.0 - Toronto Meetup -- May 2014
Big SQL 3.0 - Toronto Meetup -- May 2014
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patterns
 
Oracle Autonomous Database for Developers
Oracle Autonomous Database for DevelopersOracle Autonomous Database for Developers
Oracle Autonomous Database for Developers
 
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBeganKoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
KoprowskiT_PASSEastMidsFEB16_2AMaDisasterJustBegan
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
 
Making sense of Microsoft Identities in a Hybrid world
Making sense of Microsoft Identities in a Hybrid worldMaking sense of Microsoft Identities in a Hybrid world
Making sense of Microsoft Identities in a Hybrid world
 
Databases & Microsoft SQL Server
Databases & Microsoft SQL ServerDatabases & Microsoft SQL Server
Databases & Microsoft SQL Server
 
Sql implementations
Sql implementationsSql implementations
Sql implementations
 
Extjs3.4 Migration Notes
Extjs3.4 Migration NotesExtjs3.4 Migration Notes
Extjs3.4 Migration Notes
 
Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...
Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...
Virtual Study Beta Exam 71-663 Exchange 2010 Designing And Deploying Messagin...
 
Persistence hibernate
Persistence hibernatePersistence hibernate
Persistence hibernate
 
Hibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesHibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance Techniques
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 

Similar to Where to save my data, for devs!

SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!Ben Steinhauser
 
Share point development 101
Share point development 101Share point development 101
Share point development 101Becky Bertram
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsSteve Knutson
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint BeastMark Rackley
 
SPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastSPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastMark Rackley
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501Tjarda Peelen
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your WebsiteAcquia
 
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...European SharePoint Conference
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundaryJonathan Ralton
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Brian Culver
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Arun Gupta
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Talbott Crowell
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfPatiento Del Mar
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)Igor Talevski
 
High-level Guide: Upgrading to SharePoint 2013
High-level Guide: Upgrading to SharePoint 2013High-level Guide: Upgrading to SharePoint 2013
High-level Guide: Upgrading to SharePoint 2013C5 Insight
 

Similar to Where to save my data, for devs! (20)

SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
Share point development 101
Share point development 101Share point development 101
Share point development 101
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Introduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAsIntroduction to SharePoint for SQLserver DBAs
Introduction to SharePoint for SQLserver DBAs
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
 
SPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastSPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint Beast
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501Alfresco Business Reporting - Tech Talk Live 20130501
Alfresco Business Reporting - Tech Talk Live 20130501
 
5 Common Mistakes You are Making on your Website
 5 Common Mistakes You are Making on your Website 5 Common Mistakes You are Making on your Website
5 Common Mistakes You are Making on your Website
 
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
SQL Server and SharePoint - Best Practices presented by Steffen Krause, Micro...
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
 
Serverless SQL
Serverless SQLServerless SQL
Serverless SQL
 
Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!Boost the Performance of SharePoint Today!
Boost the Performance of SharePoint Today!
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdf
 
Deep thoughts from the real world of azure
Deep thoughts from the real world of azureDeep thoughts from the real world of azure
Deep thoughts from the real world of azure
 
IBM File Net P8
IBM File Net P8IBM File Net P8
IBM File Net P8
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
 
High-level Guide: Upgrading to SharePoint 2013
High-level Guide: Upgrading to SharePoint 2013High-level Guide: Upgrading to SharePoint 2013
High-level Guide: Upgrading to SharePoint 2013
 

More from SharePoint Saturday New Jersey

Building Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App CenterBuilding Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App CenterSharePoint Saturday New Jersey
 
The Definitive Guide for When to Use What In Office 365
The Definitive Guide for When to Use What In Office 365The Definitive Guide for When to Use What In Office 365
The Definitive Guide for When to Use What In Office 365SharePoint Saturday New Jersey
 
A Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptA Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptSharePoint Saturday New Jersey
 
Improving the SharePoint Development Process with Continuous Integration
Improving the SharePoint Development Process with Continuous IntegrationImproving the SharePoint Development Process with Continuous Integration
Improving the SharePoint Development Process with Continuous IntegrationSharePoint Saturday New Jersey
 
10 points to make a rogue SharePoint environment really, really secure..
10 points to make a rogue SharePoint environment really, really secure..10 points to make a rogue SharePoint environment really, really secure..
10 points to make a rogue SharePoint environment really, really secure..SharePoint Saturday New Jersey
 
Exchange Server 2013 and SharePoint Server 2013 Integration
Exchange Server 2013 and SharePoint Server 2013 IntegrationExchange Server 2013 and SharePoint Server 2013 Integration
Exchange Server 2013 and SharePoint Server 2013 IntegrationSharePoint Saturday New Jersey
 

More from SharePoint Saturday New Jersey (17)

Building Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App CenterBuilding Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App Center
 
Azure Active Directory
Azure Active DirectoryAzure Active Directory
Azure Active Directory
 
The Definitive Guide for When to Use What In Office 365
The Definitive Guide for When to Use What In Office 365The Definitive Guide for When to Use What In Office 365
The Definitive Guide for When to Use What In Office 365
 
Sps2015 intro to office 365 admin nikkia carter
Sps2015 intro to office 365 admin   nikkia carterSps2015 intro to office 365 admin   nikkia carter
Sps2015 intro to office 365 admin nikkia carter
 
The anatomy of office 365 groups
The anatomy of office 365 groupsThe anatomy of office 365 groups
The anatomy of office 365 groups
 
Integrating SSRS with SharePoint
Integrating SSRS with SharePointIntegrating SSRS with SharePoint
Integrating SSRS with SharePoint
 
A Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with JavascriptA Beginner's Guide to Client Side Development with Javascript
A Beginner's Guide to Client Side Development with Javascript
 
SharePoint Saturday NJ 2014 Slides
SharePoint Saturday NJ 2014 SlidesSharePoint Saturday NJ 2014 Slides
SharePoint Saturday NJ 2014 Slides
 
Improving the SharePoint Development Process with Continuous Integration
Improving the SharePoint Development Process with Continuous IntegrationImproving the SharePoint Development Process with Continuous Integration
Improving the SharePoint Development Process with Continuous Integration
 
10 points to make a rogue SharePoint environment really, really secure..
10 points to make a rogue SharePoint environment really, really secure..10 points to make a rogue SharePoint environment really, really secure..
10 points to make a rogue SharePoint environment really, really secure..
 
Insights and Monitoring of SharePoint Applications
Insights and Monitoring of SharePoint ApplicationsInsights and Monitoring of SharePoint Applications
Insights and Monitoring of SharePoint Applications
 
Optimizing SQL Server 2012 for SharePoint 2013
Optimizing SQL Server 2012 for SharePoint 2013Optimizing SQL Server 2012 for SharePoint 2013
Optimizing SQL Server 2012 for SharePoint 2013
 
Integrating Office Web Apps with SharePoint 2013
Integrating Office Web Apps with SharePoint 2013Integrating Office Web Apps with SharePoint 2013
Integrating Office Web Apps with SharePoint 2013
 
Anatomy of a mail app
Anatomy of a mail appAnatomy of a mail app
Anatomy of a mail app
 
Exchange Server 2013 and SharePoint Server 2013 Integration
Exchange Server 2013 and SharePoint Server 2013 IntegrationExchange Server 2013 and SharePoint Server 2013 Integration
Exchange Server 2013 and SharePoint Server 2013 Integration
 
Term Store Navigation
Term Store NavigationTerm Store Navigation
Term Store Navigation
 
Business Intelligence
Business IntelligenceBusiness Intelligence
Business Intelligence
 

Recently uploaded

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 

Recently uploaded (20)

Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 

Where to save my data, for devs!

  • 1. Where to save my data, for devs! Benjamin J. Steinhauser NJ SPS 2014 1
  • 2. About Me • Benjamin J. Steinhauser • SharePoint Solution Architect • B&R Business Solutions • BS/MS in CS; MCP, MCTS (SP2010 Config. & Dev.) • 12+ years as ASP.NET Application Developer • 7+ years as SharePoint Developer • Creator of Open Source CodePlex Projects: • SPCAMLQueryHelper (over 45,000 downloads) • SPFileZilla (over 1,600 downloads) • SPMMDNavigator (over 1,800 downloads) • SharePoint 2010 and 2013 Custom Claims Authentication with Twitter • SharePoint 2010 Claims FBA Examples with OpenID • Author of paid products: SharePoint Metro Grid Web Part, SharePoint Swipe Gallery Web Part • Presenter at SP User Groups and SharePoint Saturday Events 2
  • 3. Intro • Where do I store my application’s data? • Developers have many choices when building solutions that consume data in SharePoint, what are best practices? • Who: is the consumer of the data? • What: is the type of data being saved? • When: is the data needed, and for how long should it persist? • Why: is the data being stored in the first place!? • Where: is the data being stored? 3
  • 4. Consider… • What are the advantages/disadvantages for each option? • What are the restrictions? • What type of data is it? • Settings, configuration, licensing • Structured data (employees, favorites, HR forms, etc.) • How long should the data persist? • Who is the data consumer? • End user, Power User, Administrator • Web Part, Application Page, Timer Job, Web Service, Service Application • Is the data sensitive? Does it require encryption? • Is Performance a factor? (always consider caching) 4
  • 5. Where is my data!? 1. Database 2. SharePoint List 3. SP Secure Store 4. Property Bags 5. Web Part Properties 6. Web.config 7. SPPersistedObject 5
  • 6. 1. Databases • MS SQL Server, Oracle, MySQL • CRUD: create, read, update, delete • For structured data, relational data • Easy (if you know SQL), very fast • Ways to interact: • LINQ to SQL • LINQ to Entity • Stored Procedures • Inline-SQL in .NET • But… • Farm solutions only (not for Sandbox Solutions) • Database needs to be created (database administrator) • Permissions need to be configured (database administrator) • Contexts need to be built (when using LINQ) • Another actual “layer” to manage • Connections strings need to be saved (more data!) • “Put it in a list, duh!”, not so fast, does it need the SP overhead? • Better for custom business applications that store lots of data, specialized data, data that doesn’t need to be accessible via a List, Searched. 6
  • 7. 2. SharePoint List • ECM: Site Columns, Content Types, Custom Lists • BCS External Lists too! Combine database, enterprise data with SP • Provisioning: Create on Feature Activation, packaged in WSP • Site level (root web), Web level (each web site) • Accessible to Normal Users, Power Users, and Admins • Sandbox Solutions supported • Many ways to interact: • SharePoint Object Model (c#, vb.net) • LINQ to SharePoint (SPMETAL) (c#, vb.net) • SPQuery (with CAML) • SPSiteDataQuery: cross site list queries • SP Client Object Model: from JS, Silverlight, .NET (no anon access) • REST (listdata.svc, _api) (no anon access) • ASMX SOAP Web Services: deprecated • CodePlex SPServices: uses the soap web services, but yes anon access! 7
  • 8. Cont’d • For saving settings, existing implementations: • My Custom Config List • ***Codeplex: http://spconfigstore.codeplex.com • SharePoint Enterprise Patterns and Practices 8
  • 9. Cont’d • Pros: • User Interface: Standard user interface: New, Display and Edit forms • Change Management: Support for change management (simple one-step approvals, full workflows) • Alerts: Users can be alerted when settings are changed • Versioning: Versioning and the ability to roll back changes to a previous value • Auditing: Determine who made changes and when they were made • Security: Security trimming and the ability to set security as granular as a specific list item • Backup/Restore: Taken care of already as part of your normal content database disaster recovery operations • Recycle Bin: Ability to take advantage of the Recycle Bin • Scope: Granularity can be achieved by using multiple settings lists at different levels (ex. in Central Administration for items scoped to a server farm or Web application, in the root Web site of a site collection for items scoped for the site collection, in any site for items scoped to the site itself • Cons: • Performance: Implications if settings are used repeatedly in a high volume environment (use cache!) • Limitation on the types of values: Lists can only store simple values, strings, numbers, etc. They cannot store objects. Even storing serialized objects significantly limits their usefulness because it means that the standard forms are largely useless. • Settings removal: Potential for orphaned settings if a piece of functionality is removed but the corresponding setting SPListItem does not get properly cleaned up. • List deletion: Serious problems if the settings list is deleted. (fixes: proper security, hidden lists) 9
  • 10. DEMO: Config List Reader • Custom List created in Feature Activation • Filled with default data • Custom Class: ConfigListHelper • CreateConfigList() • GetAllValsElev() • GetAllVals() • Custom application page: • Reads all config data into Hashtable • Displays to page 10
  • 11. BONUS: LINQ to SP • Enables you to use Language Integrated Query (LINQ) queries • Translates LINQ queries into Collaborative Application Markup Language (CAML) queries. • Sandbox Solutions supported • Steps: • Generate Entity Classes (using SPMETAL.exe) • Write LINQ queries in C# or VB.NET • Run solution • Pros: • No more CAML! Natural Language syntax, or Expression syntax • Cons: • Need to build context • SPMETAL.exe by default builds entity classes for ALL lists, content types, etc. • Can customize this with xml parameters file, see MSDN • Chicken and Egg problem: must create a list and deploy to run SPMETAL to build the context on it. 11
  • 12. DEMO: LINQ to SP • Feature Activation, Event Receiver: • Create List, “Best SharePoint Blog Sites” • Fill with sample data • SPMETAL BAT file, creates Entity context • SPSVB2014Linq.cs • Custom Application Page: • Display ListItems • Add a ListItem 12
  • 13. 3. Secure Store • Secure Store Service provides a way to map credentials and delegate access to remote resources. • The Secure Store Service integrates seamlessly with Business Connectivity Services (BCS). • Features an API that can be taken advantage of within custom development projects. • Makes it an attractive option for storing configuration data. • The Secure Store Service allows us to create Target Applications which house sets of credentials. • The two main types are Individual and Group applications: • Individual: credentials are mapped to individual users • Group: all users share the same set of credentials. • Required Assemblies: • Microsoft.BusinessData.dll • Microsoft.Office.SecureStoreService.dll (GAC) • Not available from SPCOM (JSOM), not sure about Sandbox Solutions. • Read permissions required, either explicit or through elevation/impersonation 13
  • 15.
  • 16.
  • 17.
  • 18. DEMO: Using Secure Store • Custom Class • SecureStoreHelper.GetCredentialsFromSecureStoreService(applicationId) • applicationId: string (ex. “SqlServerTest”) • Custom Application Page • Get saved settings from Secure Store • Using “Application Id” 18
  • 19. 4. Property Bags • Hashtable/Dictionary collections to store simple objects (string, int) • Can use Serialization to save custom objects, Lists, collections, etc. • PropertyBags are available here (everywhere!): • SPContentDatabase • SPFarm: Farm admins only; no Sandbox; WFE read-only(?) • TimerJob: Each timer job has its own bag; Farm admins only; no Sandbox • SPServer • SPWebApplication: Each web app has its own bag; Farm admins only; no Sandbox; WFE read-only(?) • Site Collection (SPSite.RootWeb): Using root web, web admin to edit; root web read access to read; Sandbox supported • SPWeb: Web admin to edit; web read access to read; Sandbox supported • List (SPFolder): via root folder, List owner to edit; list read access to read; Sandbox supported • SPListItem • SPFile 19
  • 20. Cont’d • Pros: • Easy to use (native SP functionality in SOM) • Scope: very granular because they are per-object • Backup/Restore: taken care of as part of your content database recovery operations • Management: properties are stored and managed with their relevant object (backing up web site saves its property bag, deleting a web site deletes its property bag) • Cons: • Availability: certain key objects do not support a property bag (ex. SPUser), although there are workarounds • No advanced capabilities to review, approve, audit, rollback changes • Difficult to store variations: can be difficult to store variations of a single setting, per-locale, per-user • Not meant for large data, approx. 4-8 KB and below • No interface to CRUD, build your own, or use a plugin (codeplex), or SPDesigner, SP Manager (2010, 2013) • http://pbs2010.codeplex.com, http://pbs2013.codeplex.com 20
  • 21. DEMO: Property Bags • Custom Class: PropBagHelper.SiteRootWeb • SafePropBagSave(site, key, value) • SafePropBagRead(site, key) • SafePropBagRead(site) • Custom Application Page: • Get all root web keys • Save a key 21
  • 22. BONUS: Serialization • Serialization: converting an object into a stream of bytes, to store or send the object • Its main purpose is to save the state of an object in order to be able to recreate it when needed (hydrating). • The reverse process is called Deserialization. • We convert bytes to strings, to save in Property Bags, ViewState, cache, etc. • Popular Formats: • XML Serialization • SOAP Serialization: Conform to the SOAP specification. SOAP is a protocol based on XML, designed specifically to transport procedure calls using XML • JSON Serialization • Tools/API: • NewtonSoft’s Json.NET • My API 22
  • 23. DEMO: Serialization • Custom Classes: • JsonExtensionMethod • XmlSerialization • Custom application page: • Local class: Person • On page load, Person created, Serialized to text, displayed in textboxes • Button to Deserialize, fill Person Objects, display IDs 23
  • 24. 5. Web Part Properties • The Web Part base class contains a set of properties that users can use to control its appearance and behavior (width, height) • A custom property is a property that you create when you need additional properties to enhance your Web Part's functionality • The custom properties you create and specify as able to be browsed are displayed automatically in the default property pane • If the default property pane isn't rich enough in functionality, you can create a custom user interface called a tool part to manipulate your custom properties • Available in Sandbox Solutions • Available in Standard and Visual Web Parts • Easy to update in custom tool pane Class, tricky to update in regular Web Part page lifecycle events • SetPersonalizationDirty() • ***Checkout required, Content Approval, Publishing 24
  • 25. DEMO: Web Part Properties • Web Part Feature • Add to page • Read web part property value • Update web part property value • Show in default properties pane • Change settings, require checkout. 25
  • 26. 6. Web.config • Usually the first place ASP.NET Developers look • We quickly find out that it’s a double edged sword • Pros: • Find file, open, add key/value pair, save … profit! • 1 LOC to access data from app • Cons: • Farm solutions only (not for Sandbox Solutions) • Have to update every WFE separately • SPWebConfigModification should be used, which may “nuke” your custom settings added manually, or “nuke” other manually entered settings • Need server access, admins only • Either don’t use this, or use this for farm-wide settings that “need” to be secured in web.config • Better yet, use a nested web.config in your applications layouts folder (saved in HIVE instead of INETPUT) 26
  • 27. DEMO: Web.config • Nested Web.config file in app “_layouts/<appname>” • Custom Class: WebConfigHelper • Designed to use modes, makes it easy to store different environments together (ex. dev, test, staging, prod) • GetMode(): get the current mode • GetKey(): get the key associated with the current mode • Custom application page: • Retrieves single property and displays 27
  • 28. 7. SPPersistedObject • For storing settings at the Farm and Web Application level • “There is no functional difference between the hierarchical object storage and a property bag that is scoped at the SPFarm level, so deciding which to choose is largely a matter of preference.” • For storing multiple settings and more complex values • Create a class that inherits SPPersistedObject • Add your settings as properties • Mark them as Persisted (with attribute) • Then use SPFarm.GetChild or SPWebApplication.GetChild • Settings saved in SP Config DB • Cons: • Requires Farm Admin to save settings • Farm solutions only (not for Sandbox Solutions) • There is no built in user interface to manage SPPersistedObjects • Must impersonate Farm admin to read and write, since access to Config database required (RunWithElevatedPrivs doesn’t help) 28
  • 29. Bonus: • Session State: not available by default in SP • ViewState/Hidden Text Fields: use serialization, page level • Cache: HTTPRuntime cache, AppPool level, watch out for load balancing, great for caching expensive SPList/DB queries • Cookies: use jQuery Cookie plugin • HTML5 Web Storage: great for SPAs • Window.localStorage, code.sessionStorage 29
  • 31.
  • 32.
  • 33. Thanks! • FREE GIVE AWAY, $100 value! • SharePoint Metro Grid Web Part, or, SharePoint Swipe Gallery Web Part • For SharePoint 2010, 2013 (on prem. & cloud) • Free download, 30 day trial, email me for free license* • http://www.amrein.com/apps/page.asp?Q=5827 • http://www.amrein.com/apps/page.asp?Q=5853 • Email: bsteinhauser@bandrsolutions.com • Presentation and Code: http://1drv.ms/1o7sZvu * Product licensed per front-end server, offer is for 1 free license for 1 front-end server. 33 Take a picture of this slide!