SharePoint Development Standards2
SharePoint Development Standards2
This is only meant as application specific standards. You should always review these
standards along with regular development standards which identify things like
naming conventions and approaches.
General Principals:
For a few well defined files such as the Web.config or docicon.xml files,
the built-in files included with SharePoint Products and Technologies
should never be modified except through official supported software
updates, service packs, or product upgrades.
In SharePoint 2007 site and list templates must be created through code and
features (site and list definitions). STP files are not allowed as they are not
updatable.
Use best practices when accessing data using the SharePoint object model.
See Working with Large Lists, Common Coding Issues When Using the
SharePoint Object Model, and Using Disposable Windows SharePoint Services
Objects
Development Decisions:
There are plenty of challenging decisions that go into defining what the right
solution for a business or technical challenge will be. What follows is a chart meant
to help developers when selecting their development approach.
Sandbox
When to use
Server-side
code
Resource
throttling
Apps
Farm
Deprecated.
Therefore, its
unadvisable
to build new
sandboxed
solutions.
Runs under a
strict CAS
policy and is
limited in
what it can
do.
Run under
an
advanced
resource
manageme
nt system
that allows
resource
point
allocation
and
automatic
shutdown
for
troublesom
Runs
crossdomain
Efficiency/
Performan
ce
Safety
e solutions.
No, and
theres no
need to
since code
runs within
the
SharePoint
farm.
Runs on the
server farm,
but in a
dedicated
isolated
process.
The
sandbox
architecture
provides
overhead.
Very safe.
Apps hosted on
separate app
servers (even
cross-domain) or in
the cloud may
cause considerable
overhead.
Very efficient.
Should IT
pros
worry
over it?
Manageab
ility
Easy to
manage
within the
SharePoint
farm.
Cloud
support
Yes
Quality Assurance:
Code should be carefully reviewed and checked. As a starting point use this
code review checklist (and provide additional review as needed).
Provide an Installation Guide which contains the following items (Note this
relates to SharePoint Deployment Standards):
o
Branding:
Editing out of the box master pages is not allowed. Instead, duplicate an
existing master page; make edits, then ensure you add it to a solution
package for feature deployment.
When possible you should avoid removing SharePoint controls from any
design as this may impact system behavior, or impair SharePoint
functionality.
All Master Pages should have a title, a description, and a preview image.
All Page Layouts should have a title, a description, and a preview image.
Deployment:
Features:
Features with event receivers should clean up all changes created in the
activation as part of the deactivation routine.
o
Ensure that all features you develop have an appropriate name, description,
updated version number and icon.
SharePoint Designer:
The only exception to this rule is for creating DataForm Web Parts.
This does not mean that SharePoint Designer should not be used for
creating and testing branding artifacts such as master pages and page
layouts.
Site Definitions:
In SharePoint 2007 site and list templates must be created through code and
features (site and list definitions).
o
Site definitions should use a minimal site definition with feature stapling.
Solutions:
The solution package should not contain any of the files deployed with
SharePoint.
Source Control:
All source code must be under a proper source control (like TFS or SVN).
InfoPath:
If an InfoPath Form has a code behind file or requires full trust then it must be
packaged as a solution and deployed through Central Administration.
If an InfoPath form does not have code behind and does not need full trust
the form can be manually published to a document library, but the process
and location of the document library must be documented inside the form.
o
Just add the documentation text into a section control at the top of the
form and set conditional formatting on that section to always hide the
section, that way users will never see it.
WebParts
Application Configuration
There are only a few methods in which application configuration data can be
stored. When selecting the option that is right for the situation any decision
maker must review this article Managing Custom Configuration Options for a
SharePoint Application before making the decision.
o Web.config
APIs such as the ConfigurationSection class and
SPWebConfigModification class should always be used when
making modifications to the Web.config file.
References:
http://social.technet.microsoft.com/wiki/contents/articles/13373.sharepoint-2013-what-todo-farm-solution-vs-sandbox-vs-app.aspx
http://msdn.microsoft.com/en-us/library/jj164060(v=office.15).aspx
http://social.technet.microsoft.com/wiki/contents/articles/13637.sharepoint-2013-bestpractices-what-client-api-should-you-choose-when-building-apps.aspx