Data, Logic, and Presentation - The Layers of Separation

layersI've herd it said that the theme, or look, of a site is intimately tied to the content. Yet, modern web development uses a layered approach. The layered approach keeps the data, the business logic that uses and manipulates that data, and the presentation of the output separate from each other. For many designers this can be seen as a burden that breaks apart that intimacy between the look and the content. Yet, this separation is important for development and the direction the Internet is headed. So, let's take a look at why this layered approach is important.

Freedom

When web designers have their freedom to make a site look a certain way reduced due to the way a framework or content management system works they cringe and are unhappy. They may ask for a change to the system to accommodate them, find a hack work around, build a site that isn't all it could have been, or leave that framework or CMS all together. All because of a lack of freedom.

Not having this separation of layers does the same thing for developers. It takes away their freedom. It takes away their freedom to develop the functionality people are asking for. And, just like designers it makes them squirm and be unhappy.

A Few Cases

Let's look at just a few places it's required to have this separation. Let's say your a church that wants their site to get into the holiday season and look like Christmas just for the month leading up to Christmas. With this separation a designer could build a new presentation layer/theme for the site and just change it for the month.

Or, we can look at a use case from drupal.org. Recently the handbook has been exported and converted into a PDF. The PDF has it's own styling and isn't just a print off of the handbook on the website. If the content contained styling this wouldn't have been possible.

Third, let's look at the case where there is a common data store and two logic and presentation layers. This can be common for sites that have a mobile site and a regular site that are separate. They can repackage the site as a mobile site without having data duplication. If part of the presentation is stored in the data this won't work.

Not For Me?

You might be thinking that these scenarios aren't for you. That you don't run into any of these situations. This raises 2 questions for me. Why not? There are a lot of advantages from this that can save time and money while adding functionality cost effectively. What about the future? We are moving towards an aggregated web. Where sites talk to each other and share information. Companies like Google, Yahoo, and Facebook are driving some of these efforts and the users of the Internet are embracing it. Keeping this separation allows developers to embrace these types of features for small scale sites on a reasonable budget.

What About Design Freedom?

Design freedom should NOT be impacted by this layered setup. Yet, many of the frameworks and CMS out there do limit design freedom in this setup or at least make it difficult. But, in my experience it's less than we tend to think. It's a matter of learning a good way to have the freedom in design while keeping the layers for freedom in development. This requires compromise for both designers and developers in the way we do things; but, it's a compromise we need to make to have the best looking and most useful sites we can.