Site icon Constellation for Sitecore

Building Modules for Sitecore – Expert Advice

I’ve been running Sitecore development teams for 15 years here in Boston. During that time I’ve seen in-house libraries grow, mature, get neglected, and get replaced. I’ve also consumed my fair share of Marketplace modules, open-source code and blog post examples. The inconsistency of the quality, documentation, and implementation of what I’ve run across was a large driver in the creation of Constellation, and this website. Today I want to share my observations about managing an above-average sized developer toolkit.

Keep Installation as Simple as Possible

Sitecore modules tend to have three distinct concerns:

This typically means a 3-step install process, which means three opportunities for user error. Depending on what your module does, one of these concerns may be a prerequisite of another, which further complicates installs.

My Recommendation

If you follow my advice, the developer has exactly one installation step – Grab the module off of NuGet. Everything else is optional.

Ensure the Module Works as Soon as It’s Installed

It’s not enough to have your module deploy all components at once. If the module doesn’t do anything immediately after installation – i.e. some additional steps are required – programmers are more likely to go astray.

Sometimes your Foundation or Feature needs a Project level implementation, but if at all possible, provide an test/example/reference implmentation in your package that the developer can exercise immediately after deploying your module to verify installation success.

My Recommendation

Aside from verifying a successful implmentation, modules that start working immediately are easier to adopt into a programmer’s tool kit. You’ll get a higher subscriber rate.

Ensure the Module is a Good Sitecore Citizen

Many Sitecore installations today have been worked on by more than one set of developers. You can find installs with three or four sites where each site was developed by a discrete Sitecore partner. All partners tend to have their own toolkits and best practices.

My Recommendation

These recommendations apply specifically to modules that modify the HttpRequest/Response pipelines, or interface with any of the MVC pipelines. Too often I see one partner’s toolkit poisoning another partner’s implementation, or worse yet, breaking the Sitecore content editing experience. Define a scope for your module and force the developer to specify it.

Follow Sitecore Traditions Whenever Possible

Your module should look like it was built by Sitecore. Take advantage of their framework and best practices. Doing this makes your module easier to understand, compliments the programmer’s Sitecore reflexes and builds trust.

My Recommendation

No One Reads the Manual

When you publish via a NuGet package, there are lots of places where you could put your documentation: the *.nuspec file, a readme.md in the GitHub repository, the *.config files, the GitHub wiki function, or you could roll your own documentation site like I did.

My Recommendation

One of the reasons I ran my own website was to have better content entry control. GitHub’s wiki feature is okay, but it’s a little basic if you want to include sub-chapters, lots of inset images, and the like.

Config Files are Great Documentation

Sitecore has the best configuration files in the industry. The comments preceeding each section give an excellent idea of what the config section is for, what the defaults are, and why you’d want to change them.

My Recommendation

Just like Sitecore, any *.config file you distribute via NuGet should be treated as the “default” settings. Any modification should be done through an external sc:patch file in the appropriate Foundation/Feature/Project folder.

The practical reason for this is that installing updated versions of the NuGet package will override the “stock” config file. The programmer will lose their local changes.

Write an Excellent Manual

While you should assume no one will read your documentation without an invitation, it needs to exist.

Provide documentation of every aspect of your module. Doing so will force you to identify every possible use case and probably identify some edge cases you weren’t aware of when you were happily writing code in Visual Studio. Having thorough documentation also allows you to point frustrated or confused programmers at a pre-made answer. Documentation can help avoid a barrage of frequently asked questions.

Documentation also improves your module’s street cred by appearing professional. It also will provide some passive internet marketing to help adoption.

My Recommendation

Listen Closely to Developers

You are the only one on the planet that knows exactly why you module exists, and its intended purpose. Programmers will look at your module with assumptions on how it works, what functionality it actually has, and when it is applicable.

If at all possible, engage programmers directly to hunt for places where your functionalty needs to adjust to better suit the thinking of your consumers.

My Recommendation

Stay on Top of the Sitecore Release Schedule

A new release of Sitecore is a new marketing opportunity for your module.

My Recommendation

Conclusion

Writing a reusable Sitecore module and distributing it to the public is far more than a few clever lines of code. It’s the due dilligence of thoughtful packaging, thorough documentation and community awareness that makes the difference between an “accepted-best-practice” tool and another dusty entry in the Sitecore Marketplace.

Final Recommendations

Exit mobile version