Logical view
The logical view is defined using the layered architecture pattern. The system is organized into horizontal layers, where each layer has a specific role in the design.
Mercury is build on top of Sitecore and Commerce Server: the platform layer. A core principle in the design of Mercury is that the provided platform is preferably used directly, and a Foundation module is only added when it introduces new functionality. Therefore all layers are open which means that by-passing a layer is allowed. The rule is that a module (in a lower layer) should only be added when it introduces new business logic, otherwise it is allowed to by-pass layers and directly use a lower layer module (e.g. using Commerce Server directly instead of creating a Foundation module without added business logic).
Each layer consists of several modules which are, according to the Helix architecture, business-centric.
A Mercury based project consists of several layers:
- Project
- Feature (Mercury)
- Foundation (Mercury)
- Platform
Each project defines its own project specific layer, reuses the by Mercury provided layers (Feature and Foundation), and is build on top the third party Platform layer.
The architecture model follows the Helix principles and conventions, in such the top three layers are defined according to the Sitecore Architecture Conventions.
Project layer
This layer stitches all features together, and in such is project specific: it is not part of Mercury. As the project layer mainly defines glue and ideally (almost) no business logic it should be thin compared to the other layers.
The Helix documentation for the project layer can be found here.
Feature layer
This layer holds independent modules which define unique features to be used in the project layer. In Mercury each feature consists of: UI (i.e. React components), MVC controllers and views (the model is part of the Foundation layer), and Web API controllers.
Sitecore Helix forbids dependencies between features:
A strict awareness of dependencies within the Feature layer is very important. One Feature module must never depend on another Feature module as this certainly makes you lose many of the benefits that that Modular Architecture provides, such as the overall flexibility and reliability of the solution
For Mercury this is under discussion as it may make sense, e.g. for simplicity, to have some explicit and well defined dependencies between features.
The Helix documentation for the feature layer can be found here.
Foundation layer
The foundation layer holds modules that define business logic, e.g. in the form of services, on top of the platform layer. Modules in this layer do not contain presentation logic. Mercury defines in this layer data and view models (i.e. the model part of MVC), and .NET based services.
The Helix documentation for the feature layer can be found here.
Platform layer
This is the base layer on which Mercury services are defined. Modules in this layer are:
- Sitecore
- Commerce Server
- Sitecore Commerce Connect
Strictly speaking Helix defines this layer as part of the Foundation layer. From Mercury perspective this layer contains external, not to be changed, modules on top of which the Mercury foundation is build. Mercury chooses to make these external dependencies explicit in the Platform layer.