Marc Duiker

My experiences & thoughts about Azure, DevOps & personal programming projects.

Moving my blog - I <3 Github & Markdown

Moved blog to Github, writing posts in markdown.

The blogging experience

Blogging should be hassle free. With my old blog platform, blogging was far from that.

Party this was due because I deviated from the built-in themes and I hacked something custom into it. I always needed to manipulate the html of a post because the paragraphs tags and white space were off… very annoying.

And when blogging gets tedious because of such things you blog less and less. It’s been almost a year since I posted anything, which is of course unacceptable ;).

Isolating calls to Sitecore.Context for improved unit testability - Part II: ItemAdapter

I don't adapt to my environment, my enviroment adapts to me.

Recap of Part I

This is part two of the “Isolating calls to Sitecore.Context…” series. If you haven’t read the Part I please do so to get the right context (pun intended).

In Part I the GetItem() method from ItemProvider returned an actual Sitecore Item. Because of the IItemProvider interface and Sitecore.FakeDb it is possible to return fake Sitecore items and no dependency to the Sitecore context is required in unit tests.

Although unit testing is now possible there are some (minor) downsides to them due to Sitecore.FakeDb:

  1. Unit tests still require additional Sitecore assemblies and the Sitecore license file.
  2. Unit tests look a bit cluttered due to setting up the fake Db and DbItem.
  3. Unit tests are not very fast to execute.

So lets look at another way of dealing with Sitecore items to get very lean unit tests.

Isolating calls to Sitecore.Context for improved unit testability - Part I: ItemProvider, Moq and FakeDb

I find your lack of unit tests disturbing!

Sitecore projects and (un)testable code

Over the last years I’ve been involved with quite some Sitecore projects, some were true greenfield projects where a solution is created from scratch and some involved ‘only’ customizing components or extending the existing platform with new functionality. I enjoy both types of projects since they each have their challenges. I do want to share my concern from what I’ve seen in some of the latter solutions. Some things that all of these projects had in common were:

  1. Little to no utilization of an ORM, such as Glass Synthesis, CDM (or a well defined self made solution).
  2. Lack of proper testable code (no dependency injection).
  3. Lack of unit tests

Of course all these three points are related. If maintainability is important it is vital to any software project that code is written in such a way that it is unit testable. Although this post concerns isolating Sitecore, it could as well be about isolating calls to a custom database or to a logging component.

This post is intended as a practical guide for the ones involved with these ‘difficult’ projects and are strongly in favor of improving the code base in order to improve the testability and maintainability without spending many man months up front to make it happen.

Sitecore Symposium 2014 - Keynote Session (photo impression)

Barcelona Keynote Session

Michael Seifert, the CEO of Sitecore, opened the Symposium with an excellent keynote about experiences and its role in the current (and future) digital landscape. Experiences should be collected and can actually be shaped for marketing purposes. Michael showcased how Sitecore 8 can help organisations in shaping experiences for their audience.

Sitecore MVP Summit, Dev Podcasts and Newsletter

Sitecore MVP Summit Miami

Sitecore MVP Summit Miami

This week more than 60 Sitecore MVPs from 10 different countries will attend the first global Sitecore MVP summit. I consider myself very fortunate to be one of them :).

There are quite a few Dutch MVPs and many of them are able to join the summit in Miami. For the non-Dutch MVPs who are attending, I’m pretty sure you’ll be able to recognize us ;). (Make sure to check #sitecoremvpsummit on Twitter the next few days!).

Lazy Programmers User Code Snippets

Full property code snippet

The best programmers are lazy

The great Larry Wall (author of Perl) claimed that laziness is one of the greatest virtues a programmer could develop. The best programmers are lazy in the sense that they do not write duplicate code or take pleasure in writing boilerplate code. They are efficient in writing code that follows the DRY, KISS and YAGNI principles.

Visual Studio Snippet for Extension Methods

Extension method snippet

Extension methods

Using extension methods in Visual Studio can really help to reduce writing boilerplate code. Here’s a simple snippet which can be used to create extension methods.

After importing the snippet via Tools > Code Snippets Manager you can use it by typing exm[TAB].

Sitecore Introduction for Developers

Sitecore introduction for programmers


At a recent TechTalk at my employer I gave a presentation about Sitecore. The presentation was targeted towards developers who have no experience with Sitecore whatsoever. I had 30 minutes to explain and show what Sitecore is and that was the biggest challenge of the presentation, there is just too much to tell! Next time I’ll focus on one topic and go more in depth.

The HTML5 presentation is made with reveal.js and I’ve uploaded it to Azure using Dropbox (super easy!).

Have a look and feel free to share and reuse it!

Presentations for Programmers

Presentations for programmers

Great Slides + Great Speaker = Great Presentation

In the last few years I find myself doing more and more (technical) presentations. I have to admit I even start to like it. I absolutely admire great speakers like Scott Hanselman (Microsoft) and Tim Ward (Sitecore/CluedIn). They speak with such passion about technology that I immediately want to use or do whatever they promote. Although my presentation skills are nowhere near the level of these speakers I do have a good grasp of what makes a great presentation. So before becoming a great speaker lets start with creating great slides.

Marc Duiker profile

Marc Duiker

Lead Consultant @ Xpirit

Twitter || LinkedIn || Github