Tag: web application architecture
Every developer should learn the OSI model
by bretpiatt on Dec.18, 2009, under Technology
The OSI model is a great way to learn to layered design so components can be refactored or replaced without a complete system redesign. This will also allow for a project to be broken up into separate teams in the future as they’ll have a clear understanding of their upstream and downstream requirements. Beyond being able to divide a project up you also gain the ability for a new hire to jump in and really start contributing.

The OSI model visualized
This doesn’t mean you should “use the OSI model” in each project, it means you should use the principles behind it when designing the project. Lets take the OSI model concepts to a basic web application.
Application: Your web front-end that users of the site see. This should talk to a clear presentation layer API to generate any dynamic content.
Presentation: This generates the dynamic content of the site, handles encoding / decoding of data formats. You should use a standard interface to connect to your data storage (ODBC/JDBC, OS/file system abstracted file I/O).
Session: This layer should be handled by your application server (ex. Apache, Jetty, Tomcat, etc.) This can handle communicating with the networking layer of your operating system.
Layers 1-4: Most web applications don’t redesign anything here. If you’re writing an infrastructure application you may need to consider segmenting at these levels.
We’ve now gone through a single purpose, single module web application architecture. When you add a second service/module to your application ensure that communication occurs at the proper layers. Having an application layer service of module A talking directly to a session layer service of module B may sound efficient but you’ll quickly end up weaving a web that will cause long term problems down the road. All communications between modules should occur at the same layer, i.e. A:5 to B:5 to pass session data to another service.
I’d like to write more on this topic with examples so I’m going to cut it short tonight with a plan to continue in a series on this that includes an example application.