SlideShare una empresa de Scribd logo
1 de 17
Attain Clean Code in
Sitecore Solutions using
Design Patterns
Mike Reynolds
Hanson Dodge Creative
@mike_i_reynolds
Sitecore User Group Conference 2015 1
What’s a Design Pattern?
• “General reusable solution to a commonly occurring problem“
• http://en.wikipedia.org/wiki/Software_design_pattern
• Describes how to solve a problem
• Can be across different contexts
• Provides a common language for developers
• Is not a cookie-cutter code solution!
Sitecore User Group Conference 2015 2
Design Patterns: History
• Proposed by Christopher Alexander (1970s)
• A Pattern Language: Towns, Buildings, Construction
(http://amzn.to/1BtaaIH)
• Kent Beck and Ward Cunningham applied the concept to
programming (1987)
• Presented results at Object-Oriented Programming, Systems,
Languages & Applications (OOPSLA)
Sitecore User Group Conference 2015 3
Design Patterns: History
• Gang of Four (GoF) Book (1994)
• Design Patterns: Elements of Reusable Object-Oriented Software.
(http://amzn.to/UPNN2F)
• Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides
Sitecore User Group Conference 2015 4
Design Patterns: Examples
• Adapter
• Decorator
• Composite
• Chain-of-responsibility
• Null Object
Sitecore User Group Conference 2015 5
Adapter Pattern
• Allows the interface of an existing class to be used from another
• A “wrapper”
• Makes existing classes work with others without modifying their
source code
Sitecore User Group Conference 2015 6
Adapter Pattern
Sitecore User Group Conference 2015 7
Decorator Pattern
• Encapsulates an object with the same interface
• Also a “wrapper”
• Adds/removes/alters functionality on the inner instance
Sitecore User Group Conference 2015 8
Decorator Pattern
Sitecore User Group Conference 2015 9
Composite Pattern
• Encapsulates a collection of objects with the same interface
• Treats the entire collection as one object
Sitecore User Group Conference 2015 10
Composite Pattern
Sitecore User Group Conference 2015 11
Chain-of-responsibility Pattern
• Composed of command objects and a series of processing
objects
• Each processing object executes specific command objects
• Processing objects are chained together
• think linked list
• Processing objects are invoked in a cascading manner
Sitecore User Group Conference 2015 12
Null Object Pattern
• Represents the “null” state of an object
• Provides methods with no behaviour
• Removes the need of client code performing null checks
Sitecore User Group Conference 2015 13
Learn More!
• Recommend Books
• http://amzn.to/UPNN2F
• http://amzn.to/1ppJHeH
• http://amzn.to/1EZEa3z
• http://amzn.to/1bSAYsh
• Blog posts
• http://bit.ly/1E7J7JO
Sitecore User Group Conference 2015 14
Get In Touch!
Blog: http://sitecorejunkie.com
Twitter: @mike_i_reynolds
LinkedIn: http://linkd.in/1Csu1N8
Sitecore User Group Conference 2015 15
Questions?
Sitecore User Group Conference 2015 16
Thank you
Sitecore User Group Conference 2015 17

Más contenido relacionado

La actualidad más candente

Ruby on Rails: Outreach for Women, SF
Ruby on Rails: Outreach for Women, SFRuby on Rails: Outreach for Women, SF
Ruby on Rails: Outreach for Women, SF
Karen Zeller
 
WPP Hackday presentation - YQL
WPP Hackday presentation - YQLWPP Hackday presentation - YQL
WPP Hackday presentation - YQL
sriramiyer2007
 
SDLC, Agile methodologies and Career in Product management
SDLC, Agile methodologies and Career in Product managementSDLC, Agile methodologies and Career in Product management
SDLC, Agile methodologies and Career in Product management
Foyzul Karim
 

La actualidad más candente (17)

Planidoo & Zotonic
Planidoo & ZotonicPlanidoo & Zotonic
Planidoo & Zotonic
 
Ruby on Rails: Outreach for Women, SF
Ruby on Rails: Outreach for Women, SFRuby on Rails: Outreach for Women, SF
Ruby on Rails: Outreach for Women, SF
 
Software architecture : From project management to deployment
Software architecture : From project management to deploymentSoftware architecture : From project management to deployment
Software architecture : From project management to deployment
 
Lightning talk how to edit the Silverstripe CMS docs
Lightning talk how to edit the Silverstripe CMS docsLightning talk how to edit the Silverstripe CMS docs
Lightning talk how to edit the Silverstripe CMS docs
 
WDC lntroduction
WDC lntroductionWDC lntroduction
WDC lntroduction
 
Acs south coast nsw openness
Acs south coast nsw opennessAcs south coast nsw openness
Acs south coast nsw openness
 
DevOps in the Microsoft world part 1
DevOps in the Microsoft world part 1DevOps in the Microsoft world part 1
DevOps in the Microsoft world part 1
 
BizBook365 : A microservice approach
BizBook365 : A microservice approachBizBook365 : A microservice approach
BizBook365 : A microservice approach
 
An introduction to Eclipse Mylyn
An introduction to Eclipse MylynAn introduction to Eclipse Mylyn
An introduction to Eclipse Mylyn
 
Gp technologybuilds july2011
Gp technologybuilds july2011Gp technologybuilds july2011
Gp technologybuilds july2011
 
Metadata and Access Control
Metadata and Access ControlMetadata and Access Control
Metadata and Access Control
 
This Week in Neo4j - 20th October 2018
This Week in Neo4j - 20th October 2018This Week in Neo4j - 20th October 2018
This Week in Neo4j - 20th October 2018
 
Sasaki practical-linked-data
Sasaki practical-linked-dataSasaki practical-linked-data
Sasaki practical-linked-data
 
WPP Hackday presentation - YQL
WPP Hackday presentation - YQLWPP Hackday presentation - YQL
WPP Hackday presentation - YQL
 
OpenStack Swift: Panoramic View
OpenStack Swift: Panoramic ViewOpenStack Swift: Panoramic View
OpenStack Swift: Panoramic View
 
Semi-automated bank transfers with Rails and Shinsei
Semi-automated bank transfers with Rails and ShinseiSemi-automated bank transfers with Rails and Shinsei
Semi-automated bank transfers with Rails and Shinsei
 
SDLC, Agile methodologies and Career in Product management
SDLC, Agile methodologies and Career in Product managementSDLC, Agile methodologies and Career in Product management
SDLC, Agile methodologies and Career in Product management
 

Similar a Attain Clean Code in Sitecore Solutions using Design Patterns

How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
Lucas Jellema
 

Similar a Attain Clean Code in Sitecore Solutions using Design Patterns (20)

Alex Theedom Java ee revisits design patterns
Alex Theedom	Java ee revisits design patternsAlex Theedom	Java ee revisits design patterns
Alex Theedom Java ee revisits design patterns
 
SE2016 Java Alex Theedom "Java EE revisits design patterns"
SE2016 Java Alex Theedom "Java EE revisits design patterns"SE2016 Java Alex Theedom "Java EE revisits design patterns"
SE2016 Java Alex Theedom "Java EE revisits design patterns"
 
DDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichDDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan Paulovich
 
ZendCon 2011 UnCon Domain-Driven Design
ZendCon 2011 UnCon Domain-Driven DesignZendCon 2011 UnCon Domain-Driven Design
ZendCon 2011 UnCon Domain-Driven Design
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016
 
Java EE Revisits Design Patterns
Java EE Revisits Design PatternsJava EE Revisits Design Patterns
Java EE Revisits Design Patterns
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patterns
 
Software design with Domain-driven design
Software design with Domain-driven design Software design with Domain-driven design
Software design with Domain-driven design
 
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
 
Domain Specific Development using T4
Domain Specific Development using T4Domain Specific Development using T4
Domain Specific Development using T4
 
Prototyping like it is 2022
Prototyping like it is 2022 Prototyping like it is 2022
Prototyping like it is 2022
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns
 
MongoDB Basics
MongoDB BasicsMongoDB Basics
MongoDB Basics
 
Get A Head on Your Repository
Get A Head on Your RepositoryGet A Head on Your Repository
Get A Head on Your Repository
 
Editable Documents on the Web
Editable Documents on the WebEditable Documents on the Web
Editable Documents on the Web
 
Drupal 8 deeper dive
Drupal 8 deeper diveDrupal 8 deeper dive
Drupal 8 deeper dive
 
Conferences andcommunity
Conferences andcommunityConferences andcommunity
Conferences andcommunity
 
Docs as Part of the Product - Open Source Summit North America 2018
Docs as Part of the Product - Open Source Summit North America 2018Docs as Part of the Product - Open Source Summit North America 2018
Docs as Part of the Product - Open Source Summit North America 2018
 
Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)
 
Container Patterns
Container PatternsContainer Patterns
Container Patterns
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Attain Clean Code in Sitecore Solutions using Design Patterns

  • 1. Attain Clean Code in Sitecore Solutions using Design Patterns Mike Reynolds Hanson Dodge Creative @mike_i_reynolds Sitecore User Group Conference 2015 1
  • 2. What’s a Design Pattern? • “General reusable solution to a commonly occurring problem“ • http://en.wikipedia.org/wiki/Software_design_pattern • Describes how to solve a problem • Can be across different contexts • Provides a common language for developers • Is not a cookie-cutter code solution! Sitecore User Group Conference 2015 2
  • 3. Design Patterns: History • Proposed by Christopher Alexander (1970s) • A Pattern Language: Towns, Buildings, Construction (http://amzn.to/1BtaaIH) • Kent Beck and Ward Cunningham applied the concept to programming (1987) • Presented results at Object-Oriented Programming, Systems, Languages & Applications (OOPSLA) Sitecore User Group Conference 2015 3
  • 4. Design Patterns: History • Gang of Four (GoF) Book (1994) • Design Patterns: Elements of Reusable Object-Oriented Software. (http://amzn.to/UPNN2F) • Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides Sitecore User Group Conference 2015 4
  • 5. Design Patterns: Examples • Adapter • Decorator • Composite • Chain-of-responsibility • Null Object Sitecore User Group Conference 2015 5
  • 6. Adapter Pattern • Allows the interface of an existing class to be used from another • A “wrapper” • Makes existing classes work with others without modifying their source code Sitecore User Group Conference 2015 6
  • 7. Adapter Pattern Sitecore User Group Conference 2015 7
  • 8. Decorator Pattern • Encapsulates an object with the same interface • Also a “wrapper” • Adds/removes/alters functionality on the inner instance Sitecore User Group Conference 2015 8
  • 9. Decorator Pattern Sitecore User Group Conference 2015 9
  • 10. Composite Pattern • Encapsulates a collection of objects with the same interface • Treats the entire collection as one object Sitecore User Group Conference 2015 10
  • 11. Composite Pattern Sitecore User Group Conference 2015 11
  • 12. Chain-of-responsibility Pattern • Composed of command objects and a series of processing objects • Each processing object executes specific command objects • Processing objects are chained together • think linked list • Processing objects are invoked in a cascading manner Sitecore User Group Conference 2015 12
  • 13. Null Object Pattern • Represents the “null” state of an object • Provides methods with no behaviour • Removes the need of client code performing null checks Sitecore User Group Conference 2015 13
  • 14. Learn More! • Recommend Books • http://amzn.to/UPNN2F • http://amzn.to/1ppJHeH • http://amzn.to/1EZEa3z • http://amzn.to/1bSAYsh • Blog posts • http://bit.ly/1E7J7JO Sitecore User Group Conference 2015 14
  • 15. Get In Touch! Blog: http://sitecorejunkie.com Twitter: @mike_i_reynolds LinkedIn: http://linkd.in/1Csu1N8 Sitecore User Group Conference 2015 15
  • 16. Questions? Sitecore User Group Conference 2015 16
  • 17. Thank you Sitecore User Group Conference 2015 17

Notas del editor

  1. DO NOT REMOVE THIS SLIDE
  2. DO NOT REMOVE THIS SLIDE