Skip to main content

Sitecore - Module based approach

Okay so this is something I picked up from a recent developer group thingy and have been annoying my colleagues about this since then.
Instead of thinking Sitecore as one project (MVC) solution why not treat it like a module/deliverable based implementation.
I have created a sample solution which is here: https://bitbucket.org/ali_nahid/sckitchensync
 
The idea is pretty simple (Just like DDD pattern):
You get a rough idea of the entire implementation like what are the deliverable, functionalities etc etc and group them. Then just like the way you plan renderings on your page you plan bunch of different modules to implement in your solution.
In my case I divided my sitecore implementation into the following modules:
1.      The core:
This module contains the layouts and core renderings. In my case
1 standard layout that just defines the top level placeholders. Like header, footer, content etc.
And a “_MainContent” rendering that defines the other placeholders like bodycontent, bannerimage
And obviously the header, footer type of things that are going to be pretty much same throughout the entire site.
I’d give this task to “Gru” the evil genius.
2.      The Meta:
This module only handles the meta content (google meta, facebook meta, perhaps some GA code etc) of the site.
Let’s say “donny” the minion does it.
3.      The Navigation:
This module handles anything to do with site navigation like top navigation menu, breadcrumb, footer menu etc.
Let’s say “dave” the minion does it.
4.      The Imagery:
This module handles thing like “Banner”, Background, Carousel etc.
Let’s say “carl” the one eyed minion does it.
Each of these modules deal with their own set of sitecore renderings.
Interesting thing about this approach is these modules are MVC projects of its own. Sitecore is not restricting you from doing so. Who said only one MVC project for one sitecore website?
Ofcourse the "Domain POCOs" and "Service" and "Repository" layer concept exists as it is. And you can either separate them as per module or have them in their own projects is a personal preference.
 
Visualizing the above description:

instead of doing this:


We do this:


The few pros about this approach I could think of are:
1.      It can be very efficient in doing something like the following:
So you deliver a basic site with “Core, Navigation” module. Then you install/put “Imagery” Module. Then “The fancy” looking landing page module. And so on.  Each of these deliverable are independent to each other. So very less chance of breaking one while delivering the new feature because they’re all separate set of dlls.
 
2.     Easy to distribute work:
As per description each minion can take care of and be responsible for each module. This can come in handy to track progress.
3.      Once done maintaining becomes easier:
Because if something goes wrong or some changes required to make to the, for example Imagery module, you only look into “KitchenSync.Imagery.MVC” project as opposed to be bombarded by a massive MVC project.
4.      Creates a repository of re-usable components/modules. So there can be “Oakton sitecore repository” where you can search and download a module.
For example you need a navigation on your project download the navigation module from the repository.. you probably will need to made the tweak in the cshtml file to match the markup but the logic of how the navigation work remains the same. As a result you save yourself from creating bunch of sitecore renderings and classes.
5.      If gets follow through then this approach enforces a consistent culture of naming convention, field definition etc.
For example, on a page there’re often commonly 2 fields that exists. A summary and a description. Some calls it Short Description, Long Description and some calls it Summary and Description. Why not agree to one. They both mean the same.
6.      Testing is easier too. As you are testing one module at a time.
 
If you’re worried about how you launch it with IIS if there’re multiple MVC projects in the implementation, that’s not an issue either. So this is what I have done:
I have a typical sitecore installation which my IIS is pointing to and I am treating it as publish directory. My build settings puts the dlls to the publish directory /bin location so they become available to sitecore.
Then a simple powershell script copies the views to the publish directory’s Views accordingly. This script can be hooked to a VS post publish (I still don’t know how to do it)

So what you think? Worth it not Worth it? 

Comments

Popular posts from this blog

Reimagining Logs: Building AI powered Conversational Observability System

It is mid-2025 and the cogs of AI are at full speed. So we (I and Mobin) decided to do our own AI project. We called it "IntelliLogs".  IntelliLogs at a glance: Demo:  https://www.youtube.com/watch?v=OXMlORwyMQk In this post I will describe why we did what we did, what is it that we did and how we did it. I will share my personal experience. I am hoping this will, at least, be an interesting read. Table of contents: Why IntelliLogs What is IntelliLogs How IntelliLogs was developed Future of IntelliLogs Conclusion References Why IntelliLogs: Personal motivation 💪 to this were: Explore and experience what does an AI app look like from an architectural and engineering perspective Explore the realm of Huge LLMs (eg: GPT-4.1-170B,  Gemini Pro etc) vs small LLMs (eg: granite-7b, gemma-4b) Explore the possibilities of model tuning / making a model without being a data scientist. How easy or hard it is, what tools available etc. We also wanted to tackle a "not too far from ...

Hall of justice - Authorisation Greeting System

Ever since I watched the Young Justice EP-1 the security system of the Hall Of Justice and Mount Justice wow-ed me. After all it was built by Batman. You see similar AI driven voice guided system in pretty much in all sci-fi series these days. I always dreamed of having something similar of my own. Well, now I have it (sort of). Although we not quite in the flying cars era yet (disappointment) but IOT powered locks are somewhat normal these days. The adoption rate is great.  Some background: What is this Hall Of Justice Authorisation system? This is the security system that Batman built for Hall Of Justice. The movies haven't shown it yet but there're several scenes in the animated series and comic books. Basically, it is a AI powered voice guided intelligent security system that scans bio signatures (like retina, body dimensions, temperature, heart rate) through a scanning device and identifies which member of the justice league it is, logs entry then gr...

The story of a Hack Job

"So, you have hacked it" -- Few days ago one of the guys at work passed me this comment on a random discussion about something I built. I paused for a moment and pondered: Do I reply defending how that's not a hack. OR Do I just not bother I picked the second option for 2 reasons: It was late. It probably isn't worth defending the "hack vs" topic as the comment passed was out of context. So I chose the next best action and replied "Yep, sure did and it is working great.". I felt like Batman in the moment. In this post I will rant about the knowledge gap around hacking and then describe about one of the components of my home automation project (really, this is the main reason for this post) and use that as an example how hacking is cool and does not always mean bad. But first lets align on my definition of hacking: People use this term in good and bad, both ways. For example: "He/she did a hack job" -- Yeah, that probably...

Jenkins on k8s - can it be this easy?

 As developers or devops we have had a somewhat love and hate relationship with Jenkins like "love oss based ci/cd that can be hosted on any environment with ranges of community plugins for pretty much anything" BUT "hate messy UI, lack of documentations, difficult to configure" etc etc. But this post isn't about pros and cons of Jenkins, rather it is about how you can get Jenkins on your k8s super quick and easy (using Merlin). Git Repo:  https://github.com/alinahid477/jenkinsonk8s Table of contents: Why Jenkins Why Merlin for Jenkins What is Merlin for Jenkins How Merlin for Jenkins works How Jenkins on k8s work Some anticipated FAQs Why Jenkins Jenkins remains a popular choice when it comes to CICD solution with a massive community of users and contributors (despite the fact there are new cool kids in block like Tekton etc). The way I see it (because of our love and hate relationship with it) "Jenkins is not CICD tool that you want it's the CICD t...

Smart wifi controlled irrigation system using Sonoff and Home Assistant on Raspberry Pi - Part 1

If you have a backyard just for the sake of having one or it came with the house and you hate watering your garden or lawn/backyard then you have come to the right place. I genuinely believe that it is a waste of my valuable time. I would rather watch bachelorette on TV than go outside, turn on tap, hold garden hose in hand to water. Too much work!! Luckily, we have things like sprinkler system, soaker etc which makes things a bit easy. But you still have to get off that comfy couch and turn on tap (then turn off if there's no tap timer in place). ** Skip to the youtube video part if reading is not your thing   When I first moved into my house at first it was exciting to get a backyard (decent size), but soon that turned on annoyance when it came down maintaining it, specially the watering part. I laid bunch sprinklers and soaker through out the yard and bought tap timer but I still needed to routinely turn on the tap timer. Eventually few days ago I had enough of this rub...

Do you even Kubernetes ? - in private cloud

Kubernetes (“koo-burr-NET-eez”) /κυβερνήτης/ - Can be used as noun or verb. Noun "helmsman" or "pilot" or "Orchestrator". We use Kubernetes to achieve resiliency for our application. Verb Perform the act of doing Kubernetes. When done using TKG it is easy but can be super hard if the right tool is not used. Do you even Kubernetes? If I were to survey about how many people in IT industry (regardless of role) knows or at least heard about Kubernetes I would be very surprised if the percentage came out any less than at least 80%. I am curious though, How many people have actually deployed on Kubernetes? How many people have created a Kubernetes cluster? How? The answer could go either way of "Yeah, it's easy" OR "Dude!! it's hard". This is because, in my opinion, it all depends on choosing the right toolset that are fit for purpose. In this post I will create a Kubernetes cluster and deploy a microservice application End-To-End, th...