Building High Quality Solutions with Design Patterns & Application Foundations for SharePoint 2010 presented by Christoffer von Sabsay
Upcoming SlideShare
Loading in...5
×
 

Building High Quality Solutions with Design Patterns & Application Foundations for SharePoint 2010 presented by Christoffer von Sabsay

on

  • 230 views

One of SharePoint’s greatest strengths is its flexibility and the possibility to quickly build powerful solutions with the web UI and SharePoint Designer. However, when building business critical ...

One of SharePoint’s greatest strengths is its flexibility and the possibility to quickly build powerful solutions with the web UI and SharePoint Designer. However, when building business critical enterprise applications, it’s important to make your solution maintainable by using the same standard design patterns and best practices that applies to ordinary .NET development.

In this session, we will talk about several different design patterns such as repository, service location and model-view-presenter that will help you build SharePoint solutions that are flexible, testable and maintainable. We will discuss the different considerations you have to make when deciding to use these patterns. We will also go through the Application Foundations library for SharePoint 2010 from Microsoft, which provides support for managing configuration, service location and logging.

Statistics

Views

Total Views
230
Views on SlideShare
230
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

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

Building High Quality Solutions with Design Patterns & Application Foundations for SharePoint 2010 presented by Christoffer von Sabsay Building High Quality Solutions with Design Patterns & Application Foundations for SharePoint 2010 presented by Christoffer von Sabsay Presentation Transcript

  • Th26 - Building High Quality Solutions with Design Patterns & Application Foundations for SharePoint 2010 Christoffer von Sabsay christoffer.von.sabsay@sogeti.se
  • Agenda • • • • • Design Patterns – what, why and when? Repository Pattern Service Locator Pattern Model-View-Presenter Pattern Application Foundations for SharePoint 2010
  • SharePoint vs .NET development • SharePoint is just a .NET application, right? • So are there really any differences between SharePoint and plain .NET development?
  • Design Patterns • What is it? • Why should we use it? • When should we use it?
  • Repository Pattern Business Entity Client Business Logic Repository Persist Retrieve Business Entity Data Source Entity – Data Mapping
  • Model-View-Presenter Pattern View IView Presenter Model
  • Service Locator Pattern Service A Class Service Locator Service B
  • Application Foundations for SP2010 • SharePoint Service Locator • Logger • Configuration Settings Manager
  • SharePoint Service Locator using Microsoft.Practices.ServiceLocation; using Microsoft.Practices.SharePoint.Common.ServiceLocation; IServiceLocator serviceLocator = SharePointServiceLocator.GetCurrent(); IServiceLocatorConfig typeMappings = serviceLocator.GetInstance<IServiceLocatorConfig>(); typeMappings.RegisterTypeMapping<IService1, Service1>(); IService1 service1 = serviceLocator.GetInstance<IService1>();
  • Other options for Service Location • • • • • Custom implementation Unity Spring.NET StructureMap Other frameworks
  • Logger using Microsoft.Practices.ServiceLocation; using Microsoft.Practices.SharePoint.Common.ServiceLocation; using Microsoft.Practices.SharePoint.Common.Logging; using Microsoft.SharePoint.Administration; IServiceLocator serviceLocator = SharePointServiceLocator.GetCurrent(); ILogger logger = serviceLocator.GetInstance<ILogger>(); logger.TraceToDeveloper("My message."); logger.TraceToDeveloper("My message.", TraceSeverity.High); logger.LogToOperations(msg, EventSeverity.Error);
  • Configuration Settings using Microsoft.Practices.ServiceLocation; using Microsoft.Practices.SharePoint.Common.Configuration; using Microsoft.Practices.SharePoint.Common.ServiceLocation; IServiceLocator serviceLocator = SharePointServiceLocator.GetCurrent(); IConfigManager configManager = serviceLocator.GetInstance<IConfigManager>(); IPropertyBag bag = configManager.GetPropertyBag(ConfigLevel.CurrentSPWebApplication); configManager.SetInPropertyBag("MySetting", DateTime.Now, bag); IHierarchicalConfig config = serviceLocator.GetInstance<IHierarchicalConfig>(); if(config.ContainsKey("MySetting")) lastUpdate = config.GetByKey<DateTime>("MySetting"); configManager.RemoveKeyFromPropertyBag("MySetting", bag);
  • Summary • Learn about the different design patterns and when to use them • Use Application Foundations for common tasks such as configuration and logging
  • Questions?
  • Resources Developing Applications for SharePoint 2010 http://msdn.microsoft.com/en-us/library/ff770300.aspx Developing Applications for SharePoint 2007 http://msdn.microsoft.com/en-us/library/ff800762.aspx Application Foundations for SharePoint 2010 http://msdn.microsoft.com/en-us/library/ff798371.aspx
  • Keep in touch! E-mail: christoffer.von.sabsay@sogeti.se Blog: http://christoffervonsabsay.wordpress.com Twitter: sabsay