#SPSSAN June 30, 2012 San Diego Convention Center WRITING TESTABLE CODE In SharePoint.

Slides:



Advertisements
Similar presentations
Apache Struts Technology
Advertisements

INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
Spring, Hibernate and Web Services 13 th September 2014.
Jeff Derstadt Senior Development Lead Microsoft Corporation Patterns & Architecture.
ASP.NET MVC Best Practices Simone Chiaretta Solution Developer, Avanade 21 Ottobre 2009.
WPF MVVM Training Michael Sync (Silverlight MVP).
Who am I? ● Catalin Comanici ● QA for 10 years, doing test automation for about 6 years ● fun guy and rock star wannabe.
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
By Bob Bunson  Simulation of software development project  Fictitious system from Concept to Code  Oriented around the.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
Behavioral Patterns  Behavioral patterns are patterns whose purpose is to facilitate the work of algorithmic calculations and communication between classes.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces Benjamin Day.
San Diego 2014 SharePoint Saturday San Diego November 15, 2014 UCSD Extension SharePoint Saturday San Diego November 15, 2014 UCSD Extension.
San Diego 2014 SharePoint Saturday San Diego November 15, 2014 UCSD Extension SharePoint Saturday San Diego November 15, 2014 UCSD Extension.
Entity Framework Code First End to End
Introduction to the Spring Framework By: Nigusse A. Duguma Kansas State university Department of Computer Science Nov 20, 2007.
Spring Overview, Application demo -Midhila Paineni 09/23/2011 Spring Overview, Application demo9/8/20151.
Presenter - Donn Felker.  Senior Consultant for Microsoft Gold Certified Partner- Statêra.  8 years of experience in developing and architecting enterprise.
#SPSSAN June 30, 2012 San Diego Convention Center SHAREPOINT WORKSPACE Don
.NET Database Technologies: Entity Framework additional notes – part 2.
@benday #vslive Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
#SPSSAN June 30, 2012 San Diego Convention Center ENTERPRISE COLLABORATION AND THE CLOUD How to integrate cloud-based SharePoint into enterprise collaboration.
MVC and MVP. References enter.html enter.html
Domain Driven Design. Set of blog posts spanning 10 months – building an app Fefactored along the way code to Patterns eg repository.
San Diego 2014 SharePoint Saturday San Diego November 15, 2014 UCSD Extension SharePoint Saturday San Diego November 15, 2014 UCSD Extension.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Building Web Sites with ASP.NET MVC Framework Noam King CTO Sela College
CS 325: Software Engineering March 17, 2015 Applying Patterns (Part A) The Façade Pattern The Adapter Pattern Interfaces & Implementations The Strategy.
#SPSSAN June 30, 2012 San Diego Convention Center 10 FREE TOOLS YOU SHOULD HAVE IN YOUR SHAREPOINT TOOLBOX.
@DNNCon Don’t forget to include #DNNCon in your tweets! Effective Unit Testing for DNN James McKee Solutions Developer / Enterprise
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
Enterprise Content Management in SharePoint 2010 inplace autotagging with term sets Ivan Sanders SharePoint MVP Developer, Evangelist Dimension Solutions.
Domain and Persistence Patterns. Fundamental Pattern Types Design Patterns Business Logic Patterns.
Refactoring for Testability (or how I learned to stop worrying and love failing tests) Presented by Aaron Evans.
#SPSSAN June 30, 2012 San Diego Convention Center BEST PRACTICES FOR MANAGING SHAREPOINT PERMISSION LEVELS SharePoint 2010 Tony Rockwell.
Using Mock Objects with Test Driven Development Justin Kohlhepp
Alternative Architectures: Inversion of Control Mike Hadlow mikehadlow.blogspot.com.
IACRAO 75th ANNUAL MEETING Conference Theme Here!.
Getting started with ASP.NET MVC Dhananjay
The Start Menu……..Exposed What you never knew existed.
Secrets of an Umbraco Ninja Presented by : Aaron powell.com.
How to implement the Repository Pattern in an ASP.NET MVC Application Dhananjay Kumar Developer Evangelist – Infragistics Microsoft MVP
ASP.NET MVC An Introduction. What is MVC The Model-View-Controller (MVC) is an architectural pattern separates an application into three main components:
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Testing WebForms w/ Model-View-Presenter Erik Peterson.
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
Dependency Injection with Guice Technion – Institute of Technology Author: Gal Lalouche - Technion 2016 ©
Understanding Dependency Injection… and those pesky containers Miguel A. Castro Architect -
Apps for the modern enterprise INTRODUCTION TO SHAREPOINT AS A DEVELOPMENT PLATFORM RON COURVILLE.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Model View Presenter Design Pattern Jay Smith PMO Architect and Evangelist Tyson Foods, Inc.
Introduction to ASP.NET MVC [Name] [ Address] [Blog URL]
San Diego 2014 SharePoint Saturday San Diego November 15, 2014 UCSD Extension SharePoint Saturday San Diego November 15, 2014 UCSD Extension.
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Dependency Injection Andres Käver, IT College 2016/2017 Spring.
Building Web Applications with Microsoft ASP
Design Patterns: Model View Controller
Unit Testing & Test-Driven Development for Mere Mortals
Unit Testing & Test-Driven Development for Mere Mortals
Intro to Spring CJUG - January 2013.
Visio 2013 and Visio Services
Model-View-Controller Patterns and Frameworks
Accessing Data in a .NET Web Application
Unit Testing & Test-Driven Development for Mere Mortals
UI test automation of MVC apps with Microsoft Edge WebDriver
Dependency Inversion principle
Extending Interface Based Design
Presentation transcript:

#SPSSAN 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

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

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

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

#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

#SPSSAN The After-Party : SharePint Karl Strauss Brewing Company 1157 Columbia Street San Diego, CA Phone: Immediately following event closing & prize drawings 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!