Hard learned SharePoint development tips
Upcoming SlideShare
Loading in...5
×
 

Hard learned SharePoint development tips

on

  • 819 views

SharePoint development is a pain. You need a big VM, lots of RAM, can’t use any of the new fun stuff they show you at TechED. The API can be cumbersome, documentation can be as trustworthy as your ...

SharePoint development is a pain. You need a big VM, lots of RAM, can’t use any of the new fun stuff they show you at TechED. The API can be cumbersome, documentation can be as trustworthy as your average Russian banker.

How is a SharePoint developer to be productive and write reliable code in such a hostile environment? This hard learned session is both funny and sad at the same time where Sahil describes some of his painfully learnt development lessons.

Sahil Malik

Statistics

Views

Total Views
819
Views on SlideShare
819
Embed Views
0

Actions

Likes
0
Downloads
22
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Hard learned SharePoint development tips Hard learned SharePoint development tips Presentation Transcript

    • Hard learned SharePoint dev tips SAHIL MALIK WWW.WINSMARTS.COM @SAHILMALIK SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013 ZAGREB, NOVEMBER 27-28 2013
    • sponsors
    • C:>whoami 11xMVP 15xAuthor Pluralsight Author Microsoft Metro Trainer Funny and Honest HTTP://BLAH.WINSMARTS.COM @SAHILMALIK
    • Hard learned SharePoint dev tips 0945AM Hard learned CSOM and REST 0345PM
    • Lists and Document Libraries
    • Lists live in SPWebs
    • dbo.AllLists
    • Primary Key for AllLists
    • Content Types – will make performance worse
    • tp_Fields
    • dbo.AllUserData
    • My Test List
    • Example
    • Example 2
    • tp_ColumnSet
    • Sparse Columns
    • AllUserData tp_ID identify the list item tp_GUID To uniquely identify the list item tp_ListId To identify which list the item belongs to. tp_SiteId To identify which site the item belongs to. It is the value of ‘Id’ in ‘AllSites’ table tp_RowOrdinal Zero based ordinal index in the set of rows representing the list item tp_Author User who created the list item tp_Editor User who last edited the list item tp_Modified Modified date tp_Created Created date tp_DeleteTransactionID Not 0x if the item is in recycle bin tp_IsCurrentVersion (bit) 1 or 0, identifying latest version nvarchar1..64 Stores values of application fields of type nvarchar ntext1..32 Stores application fields of type ntext bit1..16 Application fields of type bit datetime1..8 Application fields of type datetime
    • AllUserData float 1..12 Application fields of type float Int1..16 Application fields of type int sql_variant1..8 Application fields of type sql_variant
    • AllUserData - takeaways
    • Now lets talk documents!
    • Test Data
    • How are documents stored?
    • Document Storage
    • DocStreams
    • Scientifically accurate picture of RBS
    • Document Storage – Lessons Learnt
    • Careful of iterators! Avoids multiple calls to DB Does not create SPListItemCollection over and over again
    • Number of Items in a list
    • SPQuery is your friend 2147483648 And its getting every single column!
    • Avoid reloading objects
    • SharePoint objects are not threadsafe!
    • Getting a list proc_EnumLists proc_MapUrlToListAndView proc_EnumLists loads all information of all lists in the SPWeb object, and then does a .Title comparison to find the list you need. proc_MapUrlToListAndView finds the GUID for the associated list, and then loads the metadata for the list you need.
    • Deleting Items
    • Good vs Evil Evil Good SPList.Items.Count SPList.ItemsCount SPList.Items[Guid] SPList.GetItemByUniqueId(Guid) SPList.Items[Int32] SPList.GetItemById(Int32) SPList.Items.GetItemById(Int32) SPList.GetItemById(Int32 SPList.Items.NumberOfFields SPQuery + ViewFields SPList.Items.ReorderItems Use SPQuery.ListItemCollectionPosition to do paging SPFolder.Files.Count SPFolder.ItemCount
    • .Dispose
    • .Dispose
    • questions? HTTP://BLAH.WINSMARTS.COM @SAHILMALIK
    • thank you. SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013 ZAGREB, NOVEMBER 27-28 2013