Do you really know three layered webdesign?
Monday, January 12th, 2009This is a topic that is well known and understood. Export the css layer and the javascript layer into files that can then be included in all your files, right? Not quite, that is an “object oriented” approach, which has nothing to do with three layered design. The “oo” approach is about unity and reuse of code. Many people have this misconception, and the result is that it is making an impact on the web in general.
It’s not only personal websites that fall into this trap. I stopped at McDonalds between Sydney and Canberra on a trip. To my great delight they had free wifi for their customers. So I pulled out my iPod and tried to connect. No dice. The EULA was Javascrip based, so I couldn’t click agree. And this is only one of many places that does this.
This brings us to the main question: What is the three layered webdesign theory?
There are many analogies used to explain this, and my favorite has always been the onion. Imagine a three layered onion. Look at it from the outside and you can see that it is an onion. Peal off one layer, and you can still see that it is an onion, a little bit smaller, but still an onion. Peal of one more and… you get the point.
Now after pealing off one or two layers, does the functionality of the onion decrease? No, it is still an onion and still does what it is supposed to do. In Webdesign; the outer layer is Javascript, middle is CSS and in the center is the content.
The theory states that you can not let the base functionality (submitting forms, navigating etc) of your site be dependent Javascript nor CSS. This has to be available in the content layer. You can’t use Javascript to load content, unless you make sure the content can also be loaded for a user who has Javascript disabled. Of course, you are allowed to change the content layer with the other layers, ie, changing the header text with an image using CSS. Or change how a form is submitted by changing the button using Javascript.
I am a firm believer of letting the majority of visitors have access to the content of my web sites. And I am sure all of your clients will agree to this. This means you will have to cater for people without 20/20 vision, or other disabilities. Using the three layered web design approach you are well on your way to achieve an AA, if not an AAA, WCAG rating.
Remember, about ten percent of the worlds male population (~300,000,000) is colorblind. Can you afford not to cater for this group?
