SlideShare uma empresa 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante 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
 

Semelhante 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

%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Último (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
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
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 

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 do Editor

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