SlideShare a Scribd company logo
1 of 16
Download to read offline
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

More Related Content

More from European SharePoint Conference

SharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob KrehaSharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob KrehaEuropean SharePoint Conference
 
11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...European SharePoint Conference
 
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...European SharePoint Conference
 
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...European SharePoint Conference
 
SharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam ClearySharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam ClearyEuropean SharePoint Conference
 
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...European SharePoint Conference
 
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...European SharePoint Conference
 
Installing SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan RichardsInstalling SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan RichardsEuropean SharePoint Conference
 

More from European SharePoint Conference (8)

SharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob KrehaSharePoint Adoption: Bridging the Gulf presented by Bob Kreha
SharePoint Adoption: Bridging the Gulf presented by Bob Kreha
 
11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...11 Strategic Considerations for SharePoint Migration presented by Christian B...
11 Strategic Considerations for SharePoint Migration presented by Christian B...
 
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
Why Are We Still Talking About SharePoint Governance? presented by Anders Skj...
 
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
 
SharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam ClearySharePoint Authentication and Authorization presented by Liam Cleary
SharePoint Authentication and Authorization presented by Liam Cleary
 
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
Infrastructure Best Practices for SharePoint On-Premises presented by Michael...
 
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
Forms and Workflow: Putting the Right Work in the Right Place presented by Mi...
 
Installing SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan RichardsInstalling SharePoint 2013 – Step by Step presented by Alan Richards
Installing SharePoint 2013 – Step by Step presented by Alan Richards
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

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