How Sitecore MVC differs from ASP.NET MVC?

Sitecore MVC and ASP.Net MVC

Enterprise application development is a topic that has been gaining more prominence as a key area of discussion. Perhaps the most common challenge faced by enterprise developers today is the need to enable seamless communication between business and development for ultimate project success. In order to work towards this goal, enterprise developers work on architectural frameworks, more commonly referred to as technologies. One of the most common architectural formats or industry-standard web development frameworks to create scalable and extensible projects is the MVC (Model-View-Controller) framework. The MVC Framework is built on top of ASP.NET and provides a large set of added functionality relying on component-based development and testing.

Related: Benefits of Publishing Enterprise Content with Sitecore 8.2

To understand the primary differences between Sitecore MVC and MVC frameworks, it is first necessary to place it on a common ground and define MVC, since it forms the primary basis of comparison.  This leads one to understand that, on a very basic level, Sitecore MVC is essentially an additional layer of API built on As one of the leading enterprise-level content management systems built on, the primary purpose of these technologies or frameworks is to enable web editors and e-marketers to organize their websites in a way that allows them to take complete control over significant aspects of their websites such as social media integration and advanced personalization.

Primary differences

Sitecore MVC is slightly different from the conventional MVC, but the basic concept remains the same. Let’s compare the two on specific terms.

  1. Request correspondence: In MVC a request always corresponds to an MVC route. This means that there is only one controller and one corresponding action involved. To elaborate, has a single controller which is being instantiated to which one action is being invoked. On the other hand, in Sitecore MVC a request usually corresponds to a Sitecore item. Focusing on Sitecore Controller Renderings means that multiple controllers can be used during one request, where multiple actions are invoked.
  2. Asynchronous controllers: While standalone MVC supports asynchronous controllers, the same cannot be said of Sitecore MVC.
  3. Layout pages:net master pages are not particularly useful as a standalone option but may be used with Sitecore. Sitecore’s layout details are superior with the layout defined in the presentation details of the item.
  4. Implementation: Traditional implementation offers techniques such as filters to implement features while Sitecore provides a feature called pipelines to assist development.
  5. Multiple forms: In MVC, each form is posted to a specific controller or action. However, on Sitecore MVC, a form is usually posted to the same URL, allowing you to return the same item again. As a result of this, every action on each of your controllers is executed, without particularly considering whether it is the form that has been submitted. This can be resolved by opting to use the Sitecore Form handler to post your form to a specific controller.
  6. Access to data: The developer has to manually establish any context to access data in MVC. Sitecore invokes specific pipelines to establish a processing context for data, which contains specific layout details of the various presentation components to be invoked. This way, Sitecore provides a data repository that is typically accessed through the context item.
  7. Registering routes: In traditional MVC, developers use global.asax or other similar methods to register routes. Sitecore provides a default route to process items that specify layouts or controllers. Developers can implement pipeline processors to register components. Sitecore has a few limitations when it comes to multiple presentations of data; only one set of design details can be defined on an item.

Specific Sitecore functions

As already mentioned, Sitecore MVC has an additional layer of API that is very powerful. As a result of this, Sitecore items can be queried using a several methods/technologies, from standard .NET web forms to using MVC. Besides, Sitecore comes up with its own query languages, namely the Sitecore Query and Sitecore Fast Query.

Sitecore MVC provides ample flexibility, scalability and security. It has the ability to scale up to increasing demand and has been the most preferred enterprise solution for tech giants such as Microsoft to financial powerhouses such as American Express.

We’re listening.

Have something to say about this article? Contact us to know more or share it with us on FacebookTwitter or our LinkedIn.

Related Posts:

Author : Saranya Balachandran Date : 04 May 2017