SlideShare a Scribd company logo
1 of 36
DoThis, Don’t DoThat:
A Primer on Sitecore
Development
Presented by:
Ben Hoelting and
DaveYoungerman
Do This, Don’t Do That: A Primer on Sitecore Development
Ben
Hoelting
In truth, he’s just a big kid. He loves designing
systems that solve real world problems. There is
nothing more satisfying than seeing something you
helped develop being used by the end users. Ben is
also involved in the technology community and runs
the South Colorado .NET user group. He also
enjoys speaking at tech groups and events around
the country.
Ben Hoelting
@benhnet
b.hoelting@aspenware.com
Do This, Don’t Do That: A Primer on Sitecore Development
Dave
Youngerman
Dave Youngerman
@DavidYoungerman
d.youngerman@aspenware.com
Originally from Ohio, Dave was a biologist before he
discovered building software was his calling and
never looked back. When not creating software,
Dave likes to spend time with his wife, two boys,
and way too many pets. He also enjoys skiing,
running, scuba diving, and fishing.
Do This, Don’t Do That: A Primer on Sitecore Development
Agenda
• Accessing Sitecore Data
• Using Config System
• Dev Ops - DEMO
• Indexing
• Cache Management
• Unit Testing Sitecore - DEMO
Accessing
Sitecore Data
Do This, Don’t Do That: A Primer on Sitecore Development
Accessing Sitecore Data
• Sitecore templates contain the fields needed to
display data.
• There are two ways to access fields on a template
• By Name
• By ID
Do This, Don’t Do That: A Primer on Sitecore Development
The Wrong Way
• What happens if someone renames the field to
“Blurb”?
Do This, Don’t Do That: A Primer on Sitecore Development
The Right Way
Next steps/Resources/Questions
9
What to do
• Take a look at Glass Mapper and decide if it is right for
you
• If not create structs, constants or classes with the ids to
your templates and fields
Resources available
• http://glass.lu/
• Use Habitat as an Example.
• http://habitat.sitecore.net
Using the
Config System
Do This, Don’t Do That: A Primer on Sitecore Development
Using the Config System
• Sitecore has a very robust configuration
system
• Use showconfig.aspx to view configs
• App_config Folder
• App_configInclude Folder
Do This, Don’t Do That: A Primer on Sitecore Development
Using the Config System Cont.
• Patching Sitecore configs
Next steps/Resources/Questions
13
What to do
• Refactor any web.config changes to patches
• Use Slow Cheetah to create transforms for different
environments
Resources available
• http://tinyurl.com/j9armlv
• Use Habitat as an Example.
• http://habitat.sitecore.net
Dev Ops
Do This, Don’t Do That: A Primer on Sitecore Development
Dev Ops
• Deployment of any system that is based
on metadata is difficult
• 3rd party tools are needed
• Unicorn
• Team Development for Sitecore (TDS)
• MSBuild
• Octopus
Dev Ops
Demo
Next steps/Resources/Questions
17
What to do
• Decide between Unicorn orTeam Development for
Sitecore (TDS)
• Create build configurations for each environment and
configure them with your build server
Resources available
• http://www.teamdevelopmentforsitecore.com
• https://github.com/kamsar/Unicorn
IndexingTips
Do This, Don’t Do That: A Primer on Sitecore Development
Indexing
• Index update strategies
• You can use multiple strategies (max
of 3) to keep your indexes up to date.
• Strategies are:
• RebuildAfterFullPublish
• OnPublishEndAsync
• IntervalAsynchronous
• Synchronous
• RemoteBuild
• TimeIndexRefresh
• Manual
Indexing
Lucene vs Solr
Do This, Don’t Do That: A Primer on Sitecore Development
Indexing - Lucene
• Lucene is configured by default for content
searching.
• Stick with Lucene when...
• You don't have to index a large number of
items.
• You don't need multiple content delivery
servers.
Do This, Don’t Do That: A Primer on Sitecore Development
Indexing - Solr
• Solr is more robust, so use it when...
• You need to index large numbers of items
(50,000 and up).
• Search is your site's primary interface.
• You use multiple content delivery servers, or
you plan to in the future.
Next Steps/Resources/Questions
23
What to do
• Review Sitecore Documentation on Lucene vs Solr.
• Determine your data and scaling requirements.
Resources available
• http://tinyurl.com/gtb9bcj
Cache
Management
Do This, Don’t Do That: A Primer on Sitecore Development
Cache Types
• Different Caching Options
HTML/Web Cache
Item Cache
Data Cache
Prefetch Cache
Database
Do This, Don’t Do That: A Primer on Sitecore Development
Cache Definitions
• Prefetch Cache
• Item Information prefilled on App startup
• You configure what items are Prefetched
• Data Cache
• Cache of Item Information.
• Pretty much a flat text representation of an item
• Item Cache
• Cache an entire Item object
• HTML/Web Cache
• Cache the HTML output of a rendering
Next steps/Resources/Questions
27
What to do
• Run performance tests against your site to identify
bottlenecks where caching can be applied.
• Review Sitecore cache documentation.
Resources available
• http://tinyurl.com/h7oerhy
UnitTesting
Sitecore
Do This, Don’t Do That: A Primer on Sitecore Development
Unit Testing Sitecore
• Do use Sitecore.FakeDb to mock Sitecore
dependencies
• FakeDb allows you to create and manipulate Sitecore
content in memory.
• Enables unit testing for areas that are not unit testable from
first look (e.g. static classes, content tree, etc.)
Do This, Don’t Do That: A Primer on Sitecore Development
Unit Testing Sitecore Cont.
• Do use Sitecore.FakeDb.Autofixture to create
fake data rather than creating your own.
Do This, Don’t Do That: A Primer on Sitecore Development
Unit Testing Sitecore Cont.
• Add the following classes to your solution:
UnitTesting
Sitecore Demo
Next steps/Resources/Questions
33
What to do
• Read the Sitecore.FakeDb GitHubWiki and start
mocking Sitecore dependencies.
• Use Autofixture to prepopulate your Sitecore mocks.
• Review Sitecore.Habitat's unit tests.
Resources available
• http://tinyurl.com/z5jn4sa
Tools for Modern Web Development
34
Sitecore Development
Don’t Forget About
Performance
Unit Testing Helps Keep
Your Sanity
Developer Productivity Is
Key
If you do the right things
up front, developers can
be highly productive with
Sitecore. Setup Dev ops,
coding standards and
best practice frameworks
to increase developer
effectiveness and
efficiency.
Sitecore is relatively
heavy. That’s because it
delivers so much
functionality. It also
provides ways to tweak
the system to deliver
great performance. For
example: Caching and
Indexing.
One best practice that
will help system statbility
is unit testing. Unit
testing has been a
challenge for Sitecore
developers in the past.
Today, Sitecore FakeDB
makes unit testing
Sitecore a reality.
Do This, Don’t Do That: A Primer on Sitecore Development
Resources:
• http://www.sitecore.com
• http://habitat.sitecore.net
• Cache Info: http://tinyurl.com/gn325mc
• Solr or Lucene: http://tinyurl.com/zcu3ex6
• Sitecore.FakeDb: http://tinyurl.com/hzu9dn5
FOR DISCUSSION PURPOSESONLY. Sitecore
Confidential and Proprietary. © 2016 Sitecore
Corporation A/S. All rights reserved. Sitecore®
and Own the Experience® are registered
trademarks of Sitecore Corporation A/S. All
other brand and product names are the
property of their respective owners.

More Related Content

Viewers also liked

UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...
UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...
UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...
University Economic Development Association
 
Point elementary school team- ryan, franjo, and dylan-basket of hope-2766
Point elementary school   team- ryan, franjo, and dylan-basket of hope-2766Point elementary school   team- ryan, franjo, and dylan-basket of hope-2766
Point elementary school team- ryan, franjo, and dylan-basket of hope-2766
SuperServiceChallenge2013
 
Southern colorado yfc southern colorado youth for christ-546
Southern colorado yfc southern colorado youth for christ-546Southern colorado yfc southern colorado youth for christ-546
Southern colorado yfc southern colorado youth for christ-546
SuperServiceChallenge2013
 
Bai giang dot quy nao
Bai giang dot quy naoBai giang dot quy nao
Bai giang dot quy nao
denui2325
 

Viewers also liked (15)

My New Cv
My New CvMy New Cv
My New Cv
 
Multimedia
MultimediaMultimedia
Multimedia
 
Media practice in journalism
Media practice in journalismMedia practice in journalism
Media practice in journalism
 
UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...
UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...
UEDA 2015 Awards of Excellence - Innovation & Entrepreneurship - University o...
 
Point elementary school team- ryan, franjo, and dylan-basket of hope-2766
Point elementary school   team- ryan, franjo, and dylan-basket of hope-2766Point elementary school   team- ryan, franjo, and dylan-basket of hope-2766
Point elementary school team- ryan, franjo, and dylan-basket of hope-2766
 
Letters and numbers
Letters and numbersLetters and numbers
Letters and numbers
 
Nayan Parikh at IIM Indore
Nayan Parikh at IIM IndoreNayan Parikh at IIM Indore
Nayan Parikh at IIM Indore
 
Southern colorado yfc southern colorado youth for christ-546
Southern colorado yfc southern colorado youth for christ-546Southern colorado yfc southern colorado youth for christ-546
Southern colorado yfc southern colorado youth for christ-546
 
Bai giang dot quy nao
Bai giang dot quy naoBai giang dot quy nao
Bai giang dot quy nao
 
Translation of political texts in russia
Translation of political texts in russiaTranslation of political texts in russia
Translation of political texts in russia
 
Presentación quipo nro 3 cualitativa
Presentación quipo nro 3 cualitativaPresentación quipo nro 3 cualitativa
Presentación quipo nro 3 cualitativa
 
4 UbiTips to use rich media
4 UbiTips to use rich media4 UbiTips to use rich media
4 UbiTips to use rich media
 
MUTHU UPDATED
MUTHU UPDATEDMUTHU UPDATED
MUTHU UPDATED
 
Suggestion In ERP System Development
Suggestion In ERP System DevelopmentSuggestion In ERP System Development
Suggestion In ERP System Development
 
Kevin Keogh - The Challenges of Modern digital Government - SUGCON
Kevin Keogh - The Challenges of Modern digital Government - SUGCONKevin Keogh - The Challenges of Modern digital Government - SUGCON
Kevin Keogh - The Challenges of Modern digital Government - SUGCON
 

Similar to Do This, Don't Do That: A Primer on Sitecore Development

How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Dave Haeffner
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefox
Gennady Feldman
 
Bootstrapping your startup & building it lean: stop wasting time
Bootstrapping your startup & building it lean: stop wasting timeBootstrapping your startup & building it lean: stop wasting time
Bootstrapping your startup & building it lean: stop wasting time
Joel Gascoigne
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
Nicholas Jansma
 

Similar to Do This, Don't Do That: A Primer on Sitecore Development (20)

WTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal projectWTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal project
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
 
CodeIgniter for Startups, cicon2010
CodeIgniter for Startups, cicon2010CodeIgniter for Startups, cicon2010
CodeIgniter for Startups, cicon2010
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium Successfully
 
JavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefoxJavaScript debugging diagnostic web tools and firefox
JavaScript debugging diagnostic web tools and firefox
 
Part of the DLM story: Get your Database under Source Control - SQL In The City
Part of the DLM story: Get your Database under Source Control - SQL In The City Part of the DLM story: Get your Database under Source Control - SQL In The City
Part of the DLM story: Get your Database under Source Control - SQL In The City
 
Browser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.jsBrowser Automated Testing Frameworks - Nightwatch.js
Browser Automated Testing Frameworks - Nightwatch.js
 
Bootstrapping your startup & building it lean: stop wasting time
Bootstrapping your startup & building it lean: stop wasting timeBootstrapping your startup & building it lean: stop wasting time
Bootstrapping your startup & building it lean: stop wasting time
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
Getting Started with Selenium
Getting Started with SeleniumGetting Started with Selenium
Getting Started with Selenium
 
Getting started developing for share point
Getting started developing for share pointGetting started developing for share point
Getting started developing for share point
 
Performance - When, What and How
Performance - When, What and HowPerformance - When, What and How
Performance - When, What and How
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Intro to Yo
Intro to YoIntro to Yo
Intro to Yo
 
Visual Studio LightSwitch (Beta 1) Overview
Visual Studio LightSwitch (Beta 1) OverviewVisual Studio LightSwitch (Beta 1) Overview
Visual Studio LightSwitch (Beta 1) Overview
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!
 

Recently uploaded

%+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
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
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 Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
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
 

Recently uploaded (20)

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?
 
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
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%+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 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
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
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
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%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
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
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
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
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
 
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-...
 

Do This, Don't Do That: A Primer on Sitecore Development

  • 1. DoThis, Don’t DoThat: A Primer on Sitecore Development Presented by: Ben Hoelting and DaveYoungerman
  • 2. Do This, Don’t Do That: A Primer on Sitecore Development Ben Hoelting In truth, he’s just a big kid. He loves designing systems that solve real world problems. There is nothing more satisfying than seeing something you helped develop being used by the end users. Ben is also involved in the technology community and runs the South Colorado .NET user group. He also enjoys speaking at tech groups and events around the country. Ben Hoelting @benhnet b.hoelting@aspenware.com
  • 3. Do This, Don’t Do That: A Primer on Sitecore Development Dave Youngerman Dave Youngerman @DavidYoungerman d.youngerman@aspenware.com Originally from Ohio, Dave was a biologist before he discovered building software was his calling and never looked back. When not creating software, Dave likes to spend time with his wife, two boys, and way too many pets. He also enjoys skiing, running, scuba diving, and fishing.
  • 4. Do This, Don’t Do That: A Primer on Sitecore Development Agenda • Accessing Sitecore Data • Using Config System • Dev Ops - DEMO • Indexing • Cache Management • Unit Testing Sitecore - DEMO
  • 6. Do This, Don’t Do That: A Primer on Sitecore Development Accessing Sitecore Data • Sitecore templates contain the fields needed to display data. • There are two ways to access fields on a template • By Name • By ID
  • 7. Do This, Don’t Do That: A Primer on Sitecore Development The Wrong Way • What happens if someone renames the field to “Blurb”?
  • 8. Do This, Don’t Do That: A Primer on Sitecore Development The Right Way
  • 9. Next steps/Resources/Questions 9 What to do • Take a look at Glass Mapper and decide if it is right for you • If not create structs, constants or classes with the ids to your templates and fields Resources available • http://glass.lu/ • Use Habitat as an Example. • http://habitat.sitecore.net
  • 11. Do This, Don’t Do That: A Primer on Sitecore Development Using the Config System • Sitecore has a very robust configuration system • Use showconfig.aspx to view configs • App_config Folder • App_configInclude Folder
  • 12. Do This, Don’t Do That: A Primer on Sitecore Development Using the Config System Cont. • Patching Sitecore configs
  • 13. Next steps/Resources/Questions 13 What to do • Refactor any web.config changes to patches • Use Slow Cheetah to create transforms for different environments Resources available • http://tinyurl.com/j9armlv • Use Habitat as an Example. • http://habitat.sitecore.net
  • 15. Do This, Don’t Do That: A Primer on Sitecore Development Dev Ops • Deployment of any system that is based on metadata is difficult • 3rd party tools are needed • Unicorn • Team Development for Sitecore (TDS) • MSBuild • Octopus
  • 17. Next steps/Resources/Questions 17 What to do • Decide between Unicorn orTeam Development for Sitecore (TDS) • Create build configurations for each environment and configure them with your build server Resources available • http://www.teamdevelopmentforsitecore.com • https://github.com/kamsar/Unicorn
  • 19. Do This, Don’t Do That: A Primer on Sitecore Development Indexing • Index update strategies • You can use multiple strategies (max of 3) to keep your indexes up to date. • Strategies are: • RebuildAfterFullPublish • OnPublishEndAsync • IntervalAsynchronous • Synchronous • RemoteBuild • TimeIndexRefresh • Manual
  • 21. Do This, Don’t Do That: A Primer on Sitecore Development Indexing - Lucene • Lucene is configured by default for content searching. • Stick with Lucene when... • You don't have to index a large number of items. • You don't need multiple content delivery servers.
  • 22. Do This, Don’t Do That: A Primer on Sitecore Development Indexing - Solr • Solr is more robust, so use it when... • You need to index large numbers of items (50,000 and up). • Search is your site's primary interface. • You use multiple content delivery servers, or you plan to in the future.
  • 23. Next Steps/Resources/Questions 23 What to do • Review Sitecore Documentation on Lucene vs Solr. • Determine your data and scaling requirements. Resources available • http://tinyurl.com/gtb9bcj
  • 25. Do This, Don’t Do That: A Primer on Sitecore Development Cache Types • Different Caching Options HTML/Web Cache Item Cache Data Cache Prefetch Cache Database
  • 26. Do This, Don’t Do That: A Primer on Sitecore Development Cache Definitions • Prefetch Cache • Item Information prefilled on App startup • You configure what items are Prefetched • Data Cache • Cache of Item Information. • Pretty much a flat text representation of an item • Item Cache • Cache an entire Item object • HTML/Web Cache • Cache the HTML output of a rendering
  • 27. Next steps/Resources/Questions 27 What to do • Run performance tests against your site to identify bottlenecks where caching can be applied. • Review Sitecore cache documentation. Resources available • http://tinyurl.com/h7oerhy
  • 29. Do This, Don’t Do That: A Primer on Sitecore Development Unit Testing Sitecore • Do use Sitecore.FakeDb to mock Sitecore dependencies • FakeDb allows you to create and manipulate Sitecore content in memory. • Enables unit testing for areas that are not unit testable from first look (e.g. static classes, content tree, etc.)
  • 30. Do This, Don’t Do That: A Primer on Sitecore Development Unit Testing Sitecore Cont. • Do use Sitecore.FakeDb.Autofixture to create fake data rather than creating your own.
  • 31. Do This, Don’t Do That: A Primer on Sitecore Development Unit Testing Sitecore Cont. • Add the following classes to your solution:
  • 33. Next steps/Resources/Questions 33 What to do • Read the Sitecore.FakeDb GitHubWiki and start mocking Sitecore dependencies. • Use Autofixture to prepopulate your Sitecore mocks. • Review Sitecore.Habitat's unit tests. Resources available • http://tinyurl.com/z5jn4sa
  • 34. Tools for Modern Web Development 34 Sitecore Development Don’t Forget About Performance Unit Testing Helps Keep Your Sanity Developer Productivity Is Key If you do the right things up front, developers can be highly productive with Sitecore. Setup Dev ops, coding standards and best practice frameworks to increase developer effectiveness and efficiency. Sitecore is relatively heavy. That’s because it delivers so much functionality. It also provides ways to tweak the system to deliver great performance. For example: Caching and Indexing. One best practice that will help system statbility is unit testing. Unit testing has been a challenge for Sitecore developers in the past. Today, Sitecore FakeDB makes unit testing Sitecore a reality.
  • 35. Do This, Don’t Do That: A Primer on Sitecore Development Resources: • http://www.sitecore.com • http://habitat.sitecore.net • Cache Info: http://tinyurl.com/gn325mc • Solr or Lucene: http://tinyurl.com/zcu3ex6 • Sitecore.FakeDb: http://tinyurl.com/hzu9dn5
  • 36. FOR DISCUSSION PURPOSESONLY. Sitecore Confidential and Proprietary. © 2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.