SlideShare une entreprise Scribd logo
1  sur  19
June 30, 2012
San Diego Convention Center




WRITING TESTABLE
      CODE
               In SharePoint




                               #SPSSAN
Agenda
Introduction
Repository Pattern
IoC and Dependency Injection Patterns
Model View Presenter Pattern
Unit Testing strategies
Summary




                                        #SPSSAN
Introduction
Tightly-coupled SharePoint Code
Difficult to test Web Parts and Pages
Need a better way to organize the code
The answer: Design Patterns!




                                         #SPSSAN
What is the Repository Pattern?
Isolates the domain model from data access
Encapsulates the domain object persistence
Persistence Ignorance is bliss!
Works well when used with interfaces…




                                             #SPSSAN
Demo
Repository Pattern




      #SPSSAN
What is IoC?
Inversion of Control
Depend upon abstract types, not concrete types




                                           #SPSSAN
Benefits of Inversion of Control
Can swap out implementations later (such as different
repositories)
Allows parts of the application to be built independently
with no complicated dependencies
Can work in ASP.NET and switch over to SharePoint later




                                            #SPSSAN
What is DI?
DI = Dependency Injection
One solution to the problem instantiating abstract types
Available DI frameworks
   Castle
   Unity
   MEF
   Etc.




                                             #SPSSAN
Benefits of Dependency Injection
Can write more granular unit tests
Don’t need to hit the database for testing UI logic
Allows parts of an application to be easily swapped out
without re-compiling
Using a DI framework makes it almost seamless!




                                             #SPSSAN
Demo
IoC and Dependency Injection




                 #SPSSAN
Model View Presenter Pattern
Gets the logic out of your UI so it can be tested!
Forced separation of concerns
Can enable UI logic to be shared
Side Point: Why not use MVC in SharePoint?




                                               #SPSSAN
Demo
Model View Presenter




         #SPSSAN
Unit Testing Strategies
Test the presenters separately
Use mock views and mock repositories when testing the
presenters
Test the concrete repositories separately




                                          #SPSSAN
Demo
 Unit Tests




#SPSSAN
Summary
Design Patterns are the key to better SharePoint code!
Repository, IoC and DI patterns make testing way easier
MVP pattern gets the logic out of your UI code




                                            #SPSSAN
June 30, 2012
San Diego Convention Center




 GET THE SOURCE
      CODE!
                Source Code Link




                                   #SPSSAN
June 30, 2012
San Diego Convention Center




     CONTACT INFO
                Tim McCarthy
         tim.mccarthy@perficient.com




                                       #SPSSAN
The After-Party: SharePint



                  Karl Strauss Brewing Company
                       1157 Columbia Street
                       San Diego, CA 92101
                       Phone: 619-234-2739

Immediately following event closing & prize drawings (@6:30 pm)


                Directions (.9 miles):
                1. Head northeast on 1st Ave
                2. Turn left onto W B St
                3. Turn left onto Columbia St
                Karl Strauss will be on the left




                                                                  #SPSSAN
June 30, 2012
 San Diego Convention Center

             THANK OUR SPONSORS




Please be sure to fill out your session evaluation!

                                          #SPSSAN

Contenu connexe

Similaire à SharePoint Saturday San Diego - Writing Testable Code in SharePoint

Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...
Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...
Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...WinOps Conf
 
Make data simple in the cognitive era
Make data simple in the cognitive eraMake data simple in the cognitive era
Make data simple in the cognitive eraIBM Analytics
 
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePointTim McCarthy
 
DevOps With Chef and Azure
DevOps With Chef and AzureDevOps With Chef and Azure
DevOps With Chef and AzureMatt Stratton
 
Best practices for agile design
Best practices for agile designBest practices for agile design
Best practices for agile designIgor Moochnick
 
DAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data ModelerDAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data ModelerDATAVERSITY
 
Spsnyc 2016 JSLink Primer
Spsnyc 2016   JSLink PrimerSpsnyc 2016   JSLink Primer
Spsnyc 2016 JSLink PrimerMichael Oryszak
 
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Jwooldridge
 
SPS Toronto 2018 - Your first PowerApps in 30 minutes
SPS Toronto 2018 - Your first PowerApps in 30 minutesSPS Toronto 2018 - Your first PowerApps in 30 minutes
SPS Toronto 2018 - Your first PowerApps in 30 minutesNicolas Georgeault
 
Building a Responsive Web Design Process
Building a Responsive Web Design ProcessBuilding a Responsive Web Design Process
Building a Responsive Web Design ProcessLydia Whitehead
 
Deployment pipeline for databases
Deployment pipeline for databasesDeployment pipeline for databases
Deployment pipeline for databasesEduardo Piairo
 
Introduction to Object Oriented Design
Introduction to Object Oriented DesignIntroduction to Object Oriented Design
Introduction to Object Oriented DesignOleg Yaroshevych
 
Scaling Shiny Apps - EARL 2017 San Francisco
Scaling Shiny Apps - EARL 2017 San Francisco Scaling Shiny Apps - EARL 2017 San Francisco
Scaling Shiny Apps - EARL 2017 San Francisco Appsilon Data Science
 
The building blocks of the next web
The building blocks of the next webThe building blocks of the next web
The building blocks of the next webPier Paolo Orioli
 
The building blocks of the next web, from Customer Journey to UI Components. ...
The building blocks of the next web, from Customer Journey to UI Components. ...The building blocks of the next web, from Customer Journey to UI Components. ...
The building blocks of the next web, from Customer Journey to UI Components. ...Codemotion
 
RavenDB - Indexes Deep Dive
RavenDB - Indexes Deep DiveRavenDB - Indexes Deep Dive
RavenDB - Indexes Deep DiveAlonso Robles
 
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Sasha Goldshtein
 
Fast deterministic screenshot tests for Android
Fast deterministic screenshot tests for AndroidFast deterministic screenshot tests for Android
Fast deterministic screenshot tests for AndroidArnold Noronha
 

Similaire à SharePoint Saturday San Diego - Writing Testable Code in SharePoint (20)

Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...
Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...
Eduardo Piairo - Deployment pipeline for databases (Azure SQL Database, SQL S...
 
Make data simple in the cognitive era
Make data simple in the cognitive eraMake data simple in the cognitive era
Make data simple in the cognitive era
 
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePoint
 
Design patterns
Design patternsDesign patterns
Design patterns
 
DevOps With Chef and Azure
DevOps With Chef and AzureDevOps With Chef and Azure
DevOps With Chef and Azure
 
Best practices for agile design
Best practices for agile designBest practices for agile design
Best practices for agile design
 
DAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data ModelerDAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
DAS Slides: Data Architect vs. Data Engineer vs. Data Modeler
 
Spsnyc 2016 JSLink Primer
Spsnyc 2016   JSLink PrimerSpsnyc 2016   JSLink Primer
Spsnyc 2016 JSLink Primer
 
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
Enterprise Devops Presentation @ Magentys Seminar London May 15 2014
 
SPS Toronto 2018 - Your first PowerApps in 30 minutes
SPS Toronto 2018 - Your first PowerApps in 30 minutesSPS Toronto 2018 - Your first PowerApps in 30 minutes
SPS Toronto 2018 - Your first PowerApps in 30 minutes
 
Building a Responsive Web Design Process
Building a Responsive Web Design ProcessBuilding a Responsive Web Design Process
Building a Responsive Web Design Process
 
Deployment pipeline for databases
Deployment pipeline for databasesDeployment pipeline for databases
Deployment pipeline for databases
 
Introduction to Object Oriented Design
Introduction to Object Oriented DesignIntroduction to Object Oriented Design
Introduction to Object Oriented Design
 
Scaling Shiny Apps - EARL 2017 San Francisco
Scaling Shiny Apps - EARL 2017 San Francisco Scaling Shiny Apps - EARL 2017 San Francisco
Scaling Shiny Apps - EARL 2017 San Francisco
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
The building blocks of the next web
The building blocks of the next webThe building blocks of the next web
The building blocks of the next web
 
The building blocks of the next web, from Customer Journey to UI Components. ...
The building blocks of the next web, from Customer Journey to UI Components. ...The building blocks of the next web, from Customer Journey to UI Components. ...
The building blocks of the next web, from Customer Journey to UI Components. ...
 
RavenDB - Indexes Deep Dive
RavenDB - Indexes Deep DiveRavenDB - Indexes Deep Dive
RavenDB - Indexes Deep Dive
 
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
Performance and Debugging with the Diagnostics Hub in Visual Studio 2013
 
Fast deterministic screenshot tests for Android
Fast deterministic screenshot tests for AndroidFast deterministic screenshot tests for Android
Fast deterministic screenshot tests for Android
 

Dernier

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
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 ...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

SharePoint Saturday San Diego - Writing Testable Code in SharePoint

  • 1. June 30, 2012 San Diego Convention Center WRITING TESTABLE CODE In SharePoint #SPSSAN
  • 2. Agenda Introduction Repository Pattern IoC and Dependency Injection Patterns Model View Presenter Pattern Unit Testing strategies Summary #SPSSAN
  • 3. Introduction Tightly-coupled SharePoint Code Difficult to test Web Parts and Pages Need a better way to organize the code The answer: Design Patterns! #SPSSAN
  • 4. What is the Repository Pattern? Isolates the domain model from data access Encapsulates the domain object persistence Persistence Ignorance is bliss! Works well when used with interfaces… #SPSSAN
  • 6. What is IoC? Inversion of Control Depend upon abstract types, not concrete types #SPSSAN
  • 7. Benefits of Inversion of Control Can swap out implementations later (such as different repositories) Allows parts of the application to be built independently with no complicated dependencies Can work in ASP.NET and switch over to SharePoint later #SPSSAN
  • 8. What is DI? DI = Dependency Injection One solution to the problem instantiating abstract types Available DI frameworks Castle Unity MEF Etc. #SPSSAN
  • 9. Benefits of Dependency Injection Can write more granular unit tests Don’t need to hit the database for testing UI logic Allows parts of an application to be easily swapped out without re-compiling Using a DI framework makes it almost seamless! #SPSSAN
  • 10. Demo IoC and Dependency Injection #SPSSAN
  • 11. Model View Presenter Pattern Gets the logic out of your UI so it can be tested! Forced separation of concerns Can enable UI logic to be shared Side Point: Why not use MVC in SharePoint? #SPSSAN
  • 13. Unit Testing Strategies Test the presenters separately Use mock views and mock repositories when testing the presenters Test the concrete repositories separately #SPSSAN
  • 15. Summary Design Patterns are the key to better SharePoint code! Repository, IoC and DI patterns make testing way easier MVP pattern gets the logic out of your UI code #SPSSAN
  • 16. June 30, 2012 San Diego Convention Center GET THE SOURCE CODE! Source Code Link #SPSSAN
  • 17. June 30, 2012 San Diego Convention Center CONTACT INFO Tim McCarthy tim.mccarthy@perficient.com #SPSSAN
  • 18. The After-Party: SharePint Karl Strauss Brewing Company 1157 Columbia Street San Diego, CA 92101 Phone: 619-234-2739 Immediately following event closing & prize drawings (@6:30 pm) Directions (.9 miles): 1. Head northeast on 1st Ave 2. Turn left onto W B St 3. Turn left onto Columbia St Karl Strauss will be on the left #SPSSAN
  • 19. June 30, 2012 San Diego Convention Center THANK OUR SPONSORS Please be sure to fill out your session evaluation! #SPSSAN

Notes de l'éditeur

  1. Many developers forget good object-oriented design techniques when developing in SharePoint, most of the time because they get overwhelmed by the framework. Unit testing often gets thrown out of the window, and most of the time the application becomes very tightly coupled to the SharePoint object model. This talk will demonstrate how to overcome these obstacles and build solid SharePoint application code that is much more testable and is easier to maintain.The vehicle for this goodness is design patterns!
  2. Using the repository pattern will allow you to develop outside of the SharePoint environment "up until the last minute"
  3. Depend on abstract types (interfaces) instead of concrete classes!Don’t need a big bulky 64-bit Windows 2008 Server virtual machine until much later!
  4. MVP is good for web forms projects, which is what SharePoint is based uponModel: Defines the data to be displayed or acted upon in the UIView: UI that displays data from the Model and routes user commands to the Presenter to act upon the dataPresenter: Acts upon the model and the ViewWith MVP, the idea is to strip as much logic and code out of the UI and make it do simple things, like data binding and and acting as a facade to the various UI element properties, i.e. expose TextBox.Text property as FirstName.This pattern really pays for itself when you find bugs in the UI logic…just write a failing unit test and fix the code so it passes the test!Very difficult to use MVC in SharePoint, not worth the effort
  5. Doing TDD by the letter takes a lot of discipline. Once you start doing it, it can become a habit. But even if you don't write your tests first, if you use DI + MVP + tests later, you still will benefit from the modularity and freedom to refactor your code.Writing tests can take up time initially, but the payoff happens in spades once you have to identify and fix bugs, or refactor your code with confidence of not breaking anything else.Mock up your views and repositories so you only test what is necessary...that way your tests are really focused. You can (and should) do integration tests later where you use the real repositories. Once you have a pretty good suite of tests developed, you can freely make changes to your code and see if your tests still pass. Refactor, compile, re-test.Rinse, lather, repeat!