Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Th26 - Building High Quality Solutions withDesign Patterns & Application Foundations            for SharePoint 2010       ...
About Me    Christoffer von Sabsay    SharePoint Architect    Sogeti Sweden    MCPD, MCT
Agenda•   Design Patterns – what, why and when?•   Repository Pattern•   Model-View-Presenter Pattern•   Service Locator P...
SharePoint vs .NET development• SharePoint is just a .NET application, right?• So are there really any differences between...
Design Patterns• What is it?• Why should we use it?• When should we use it?
Repository Pattern           Business            Entity                      Repository           Persist Client          ...
Model-View-Presenter Pattern    View    IView      Presenter                Model
Service Locator Pattern                          Service AClass   Service Locator                          Service B
Benefits after applying these patterns• Repository Pattern    – Central point of access to data – can modify storage witho...
Application Foundations for SP2010• SharePoint Service Locator• Logger• Configuration Settings Manager
SharePoint Service Locator• Lightweight Service Locator• Implements the IServiceLocator interface  (Microsoft.Practices.Se...
Other options for Service Location•   Unity•   Spring.NET•   StructureMap•   Other frameworks
Logger• Utility class for logging• Two methods   – TraceToDeveloper (ULS)   – LogToOperations (Event Log + ULS)• Implement...
Configuration Settings Manager• Utility class for storing and retrieving  configuration settings• Settings can be stored i...
Summary• Learn about the different design patterns and  when to use them• Use Application Foundations for common  tasks su...
ResourcesDeveloping Applications for SharePoint 2010http://msdn.microsoft.com/en-us/library/ff770300.aspxDeveloping Applic...
Questions?
Keep in touch!E-mail: christoffer.von.sabsay@sogeti.seBlog: http://christoffervonsabsay.wordpress.comTwitter: sabsay
Upcoming SlideShare
Loading in …5
×

Building High Quality Solutions with Design Patterns & Application Foundations for SharePoint 2010

3,952 views

Published on

  • Be the first to comment

  • Be the first to like this

Building High Quality Solutions with Design Patterns & Application Foundations for SharePoint 2010

  1. 1. Th26 - Building High Quality Solutions withDesign Patterns & Application Foundations for SharePoint 2010 Christoffer von Sabsay christoffer.von.sabsay@sogeti.se
  2. 2. About Me Christoffer von Sabsay SharePoint Architect Sogeti Sweden MCPD, MCT
  3. 3. Agenda• Design Patterns – what, why and when?• Repository Pattern• Model-View-Presenter Pattern• Service Locator Pattern• Application Foundations for SharePoint 2010
  4. 4. SharePoint vs .NET development• SharePoint is just a .NET application, right?• So are there really any differences between SharePoint and plain .NET development?
  5. 5. Design Patterns• What is it?• Why should we use it?• When should we use it?
  6. 6. Repository Pattern Business Entity Repository Persist Client DataBusiness Source Logic Retrieve Entity – Data Mapping Business Entity
  7. 7. Model-View-Presenter Pattern View IView Presenter Model
  8. 8. Service Locator Pattern Service AClass Service Locator Service B
  9. 9. Benefits after applying these patterns• Repository Pattern – Central point of access to data – can modify storage without too much impact on the rest of the code – Strongly typed access to our data• Model-View-Presenter – Presentation logic separated from UI – Possible to reuse presentation logic for different Uis• Service Locator – Decoupled dependency between presenter and repository – Presenter testable in isolation – Service Locator takes care of creating and managing the lifetime of the service/repository.
  10. 10. Application Foundations for SP2010• SharePoint Service Locator• Logger• Configuration Settings Manager
  11. 11. SharePoint Service Locator• Lightweight Service Locator• Implements the IServiceLocator interface (Microsoft.Practices.ServiceLocation)• Mappings can be stored at the farm or site collection level• Default type mappings – Logging – Configuration Management
  12. 12. Other options for Service Location• Unity• Spring.NET• StructureMap• Other frameworks
  13. 13. Logger• Utility class for logging• Two methods – TraceToDeveloper (ULS) – LogToOperations (Event Log + ULS)• Implements the ILogger interface, easy to replace by custom implementation
  14. 14. Configuration Settings Manager• Utility class for storing and retrieving configuration settings• Settings can be stored in the property bag at different levels – SPFarm, SPWebApplication, SPSite and SPWeb• Also possible to store settings in a SPList
  15. 15. Summary• Learn about the different design patterns and when to use them• Use Application Foundations for common tasks such as configuration and logging
  16. 16. ResourcesDeveloping Applications for SharePoint 2010http://msdn.microsoft.com/en-us/library/ff770300.aspxDeveloping Applications for SharePoint 2007http://msdn.microsoft.com/en-us/library/ff800762.aspxApplication Foundations for SharePoint 2010http://msdn.microsoft.com/en-us/library/ff798371.aspx
  17. 17. Questions?
  18. 18. Keep in touch!E-mail: christoffer.von.sabsay@sogeti.seBlog: http://christoffervonsabsay.wordpress.comTwitter: sabsay

×