Top Banner
SPECIALISTS ON DESIGNING, IMPLEMENTING AND SCALING CUSTOM SOLUTIONS BASED ON SITECORE CMS Building Maintainable Sitecore Solutions Proven practices for Sitecore team development Thomas Eldblom CTO Pentia A/S
30
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Maintainable Sitecore Solutions

SPECIALISTS ON DESIGNING, IMPLEMENTING AND SCALING CUSTOM SOLUTIONSBASED ON SITECORE CMS

Building Maintainable Sitecore Solutions

Proven practices for Sitecore team development

Thomas EldblomCTOPentia A/S

Page 2: Maintainable Sitecore Solutions
Page 3: Maintainable Sitecore Solutions

How to Serve Sitecore

Page 4: Maintainable Sitecore Solutions

…what we could serve!

Page 5: Maintainable Sitecore Solutions

Cost of maintenanceCo

st o

f Cha

nge

Time

Page 6: Maintainable Sitecore Solutions

Layouts

Templates

Sublayouts

.NET code CSS & Design files

Settings in Sitecore

XSLT RenderingsConfigfiles

Content structure

Page 7: Maintainable Sitecore Solutions

How to build maintainable Sitecore solutions

• Component architecture • Using consistent structure and

naming.• Use version control.• Separate custom functionality from

standard functionality.• Automate configuration file

generation.• Automate trivial tasks.

Page 8: Maintainable Sitecore Solutions

Component Architecture

• Function before type• Agile design principle

– Logically grouped functionality based on cohesion.– Releasable and reusable modules.– Focus on reusability as well as maintainability.

• Simple component architecture– Structure data logically across systems

“A way must exist to deal with groups of classes, otherwise it’s almost like build a sand castle from individual grains of sand”

Robert C. Martin (Uncle Bob)

Page 9: Maintainable Sitecore Solutions
Page 10: Maintainable Sitecore Solutions

Component breakdown

• Breaking down the related functionality of the website

• Focus on cohesion in each component• Think of the concern/domain of each

component– Do the component solve a general

functionality?– Do the component solve a project

specific functionality?

Page 11: Maintainable Sitecore Solutions

Component breakdown

Navigation

Products

Search

Spots

Identity

Page 12: Maintainable Sitecore Solutions

Navigation

Products

Search

Spots

Component Breakdown

Identity

• Product data• Product presentation

•Menus• Sitemap

• Search boxes• Search results• Indexing •Corporate identity

•Header logo• Footer disclaimer

•Related information•Global marketing boxes

Page 13: Maintainable Sitecore Solutions

Component coupling

• Defines references between components• Consider each reference made– Both hard (in code) and loose (in strings)– Define new components to avoid references

• Specific components should reference general components– Stable-Dependencies Principle

• Avoid circular references– Acyclic Dependencies Principle

• Use coding patterns to avoid high coupling

Page 14: Maintainable Sitecore Solutions

Component Coupling – the common but wrong way

• Product data• Product presentation

•Menus• Sitemap

• Search boxes• Search results• Indexing •Corporate identity

•Header logo• Footer disclaimer

•Related information•Global marketing boxes

• Product list page type

• Sitemap page type

• Search results page type

Navigation

Products

Search

Spots

Identity

Page 15: Maintainable Sitecore Solutions

ProductsProducts

Component Coupling – the common but wrong way

• Product data• Product presentation

•Menus• Sitemap

• Search boxes• Search results• Indexing •Corporate identity

•Header logo• Footer disclaimer

•Related information•Global marketing boxes

• Product list page type

• Sitemap page type

• Search results page type

Navigation

Products

Search

Spots

Identity

Page 16: Maintainable Sitecore Solutions

ProductsProductsProducts

DesignPage types

Component Coupling – the right way

Navigation Search

Spots

Identity

• Product list page type• Sitemap page• Search results page

Page 17: Maintainable Sitecore Solutions

Component Architecture– @ Pentia

Page 18: Maintainable Sitecore Solutions

Consistent structure and naming

• Apply naming conventions– Be consistent with terms.–Use your naming convention across

systems.• Folder structure• Visual Studio Projects/Assemblies• Sitecore Templates• Layouts, rendering, sublayouts etc.

Page 19: Maintainable Sitecore Solutions

Folder structure on

disk

Templates in Sitecore

Renderings in Sitecore

Team Development for Sitecore

Components in Visual Studio

Page 20: Maintainable Sitecore Solutions

Advanced component architecture

• High cohesion/Low coupling• Design Principles– Reuse/Release Equivalence Principle– Common Reuse Principle– Common Closure Principle– Acyclic Dependencies Principle– Stable-Dependencies Principle– Stable-Abstractions Principle

• IoC containers• and so on…

Agile Principles, Patterns, and Practices in C#Robert C. Martin

Micah MartinISBN-10: 0131857258

Page 21: Maintainable Sitecore Solutions

Use version control

• ”Single source of the truth”• Version everything

– Component structure– Code– Layouts and renderings– Templates– Configuration changes– and so on…

• How?– Subversion, Microsoft TFS, you name it…– Use Sitecore item serialization or Sitecore TDS

Page 22: Maintainable Sitecore Solutions

Separate custom functionality from standard functionality.

• Keep track of what belongs to:– Your solution– Sitecore (versioned)– Sitecore modules– Third party modules

• How?– Separate your solution from standard

functionality in version control.– Implement one-click deployment.

• Team Development for Sitecore.• Web Applications in Visual Studio

Page 23: Maintainable Sitecore Solutions

How we do it

• The Pentia Build System and Build Library

• Central repository containing:– All Sitecore versions, modules, patches etc.– Third party modules– Pentia shared functionality

• Automated via nAnt– Copies referenced modules locally– Generates database scripts

Page 24: Maintainable Sitecore Solutions
Page 25: Maintainable Sitecore Solutions

Debug environment

Version control Build library

Page 26: Maintainable Sitecore Solutions

Automate configuration file generation

Page 27: Maintainable Sitecore Solutions

Website Backend Publishing

Website Backend Publishing

Website Backend Publishing

ProductionQ

ATest

Page 28: Maintainable Sitecore Solutions

Automate configuration file generation

• Sitecore config includes– Located in \App_Config\Include– Only works on <sitecore> section–Not environment specific– /sitecore/admin/showconfig.aspx

• Visual Studio 2010 config transformation– Environment specific merges– Only available with web.config (in Visual

Studio)

Page 29: Maintainable Sitecore Solutions
Page 30: Maintainable Sitecore Solutions

Resources

• http://www.pentia.net/professional-services

• Books:– Agile Principles, Patterns, and Practices in C#

• Robert C. Martin & Micah Martin• ISBN-10: 0131857258

– Clean Code: A Handbook of Agile Software Craftsmanship• Robert C. Martin• ISBN-10: 0132350882

• Sites:– Blog - Molten Core: http://mcore.wordpress.net– Learn Sitecore: http://learnsitecore.cmsuniverse.net