Why web applications must be kept seperate from content management

in Technology   —  

Over the years, we have come across a fair number of projects where we have been asked to take ownership of an off-the-shelf CMS platform that has previously been extended by adding complex functionality that would be better treated as a separate web application.

While such an approach might have initially seemed like an attractive shortcut, it often results in extensive modifications to the underlying CMS platform that make the resultant codebase hard to support, with CMS upgrades a major undertaking. The long term result is often a composite website/application which is hard to maintain, becomes increasingly fragile (with business logic contained in CMS fields), a lack of operational documentation and system knowledge, and unnecessary maintenance overheads.

When approaching the design and build of a new website/application it is important to clearly distinguish between the website and the web application because the content management requirements of each are considerably different.

A website is largely informational in nature with a limited amount of user functionality, which may include user registration and post to a forum, blog or wiki. The BBC and The Guardian are both examples of a website.

A web application is a web site that does something other than just display content – the web application’s primary purpose is to perform a tangible function, and users interact in a largely transactional manner. Facebook, Twitter and Pinterest are examples of a web application.

Many large sites are a combination of both. For example, HSBC (www.hsbc.co.uk) is a good example of a website with a web application contained within. A member of the public can go to HSBC's website and learn about the financial products they offer. They can also login to the Online Banking part of the site, which is a web application embedded in the site. The two parts of the site are however separate even though they share the same address with the website areas being built using a CMS, and the online banking part being developed as a separate standalone application.

The issues

While one approach is to try to “retrofit” the web application pages and user processes as pages / modules within a CMS platform (such that all pages are delivered via the CMS), this is usually counter-productive, for the following reasons:

Reason 1: Standalone applications are more robust

A web application delivered via a CMS platform is more fragile than if delivered standalone.

An administrator accessing the CMS should be able to easily move pages and modules and this can easily break web applications which rely on multiple sequential steps.

Vendor CMS upgrades will not upgrade a custom web application built into the CMS. This can cause the application to break, or the business to decide not to upgrade the CMS which over time can cause security and performance issues.

Reason 2: (TDD) Standalone applications should be developed as "MVC"

The Model View Controller is a software architecture pattern that separates the representation of information from the user's interaction with it. It decreases development time, and completely separates all aspects of the web application – ensuring each element of the site can be tested automatically.

  • A "model" holds the data needed by a particular aspect of the application.
  • A "view" encapsulates all user interface logic, and renders the data stored in the model. We use separate views for alternate mobile and desktop views.
  • A "controller" handles all user interaction, populates the model, passing it to the view.

By contrast, few CMS platforms support automated testing (test-driven development) and where a CMS platform does support “MVC” applications, it does so by making separate HTTP requests under the hood in order to retrieve a separate stream of HTML content as returned from the MVC application, and then render this out as part of the website page .

Reason 3: CMS Licensing

Web applications are often comprise significant amounts of custom code and often have significant CPU and processing requirements.

This can mean that multiple web servers are needed for hosting a highly transactional web application, and if the web application was delivered via the CMS, this could result in increased CMS licensing costs

When websites include web applications

For websites that include web applications, it is often easiest to select a single CMS platform that can manage all web content – but only publish the website pages.

The web application can query the CMS database to retrieve the granular content it needs.

The benefit of such approach means that users who view the website contact information or FAQs before logging in (on the website) also see the same content after they have logged in (within the web application).

Read next