5-Layer Web Architecture
Synopsis
As any other IT system, web systems have to concentrate on architecture considerations. This is all the more true that web applications put together many different techonologies, on both client and server side, with sometimes important overlapping.
In deed, layer definition in IT system is one of the easiest way to achieve sustainable long term development. The well known Internet Protocol is the best example of such a layered system that has proved consistency.
The intention of the article is to define Mediboard architecture the most simple and comprehensive way, based on a multi-layer architecture, more precisely on 5-layer architecture concepts.
Each layer is described with a general purpose definition and when needed, with an explanation/example applied to Mediboard project.
The various layers are also categorized according their (vertical) scope:
- Global: layer is module independant
- Local: layer is module specific
At last, each layer is cut into layer item, themselves fed with a name, a specific technology/language and responsibilities.
The big picture
Layer 1: Data persistence
- Scope: global
The data persistence layer is the low-level layer handling any kind of data in the project. Here you find databases and files systems. You also make decisions on file encoding and native — if necessary — database systems.
For instance you might need transactions or foreign keys and decide to prefer PostgreSQL to mySQL. You could also want to store files as database BLOBs or use file system for instance.
| What | Technologies | Responsibilities | |
| Relational object mapping | MySQL | CRUD (Create-Read-Update-Delete) operations | |
| File storage | MySQL, File System | version control, file management | |
Layer 2: Server-side Framework
- Scope: global
The — server-side — framework layer is probably the most important and time-consuming layer. Being generic enough will allow stability and homogeneousness of the application, and being feature rich will make concrete (module) development much faster and reliable.
It also concerns decisions on internationalization, modularization, HTTP calls, etc., but also coding standards and library use.
| What | Technologies | Responsibilities | |
| Framework language | PHP | Server side scripting | |
| Framework standards | PEAR | coding standards, QA, GP helper classes | |
| Framework fondation classes | proprietary | modularization, internationalization, form validation, HTTP requests, HTTP parameters | |
| Data access | ADOdb | DB Abstraction, DB indepandance, DB query forgery (SQL or other) | |
Layer 3: Business logics
- Scope: local
Business logics layer is the applicative layer that will provide the users with business-related functionality. Provided a good layer 2 framework, you'll be able to prevent creeping featuritis
. That layer defines concrete data metamodel, business rules and constraints.
In our case, everything that cares about patients, hospitalisation, medecins, etc., and relations between them and there properties has to be defined here.
In a few words, it handles the module-specific concrete classes implementation, in terms of data computation, form production, etc.
| What | Technologies | Responsibilities | |
| Business logics | PHP, Framework fondation classes | concrete class specialisation, form production, data computation, ... | |
| Content production | PHP arrays, PHP variables | prepares to templating | |
Layer 4: Presentation structure
- Scope: local
The general purpose of Layer 4 is to generate content structure from server-side script, here PHP, in a user agent independant manner, without any positioning or skinning considerations. Just structure the ouput.
The purest way to do so is often to produce any XML compatible information. The classical way is to choose (X)HTML for browser navigation but you could also have RSS feeds for webservice-like information sharing among different websites.
This layer could also be used to produce alternative content structure with the same Layer 3 logics.
| What | Technologies | Responsibilities | |
| Presentation production | Smarty | Structures logical information, logics to presentation one-way mapping | |
| Presentation expression | XHTML 1.0 strict | Document logics, skin abstraction | |
Layer 5: GUI client-side customization
- Scope: mostly global, could be local (the more global/generic the better)
Layer 5 is dedicated to media dependant front-end and skinning cutomization. It's also used to add a bunch of interactivity with client-side scripts.
Most of modern web applications make an extensive use of CSS. Former technologies focused on old and deprecated HTML 4.0 faicilities, with a strong depandance on web browsers implementation.
The good point is that CSS allows clean, reliable, factorized customization at very low cost/effort.
An important remark though, some poor browsers are not yet fully compatible with very advanced CSS2 techniques, so it's the stylesheet developer's responsibility to have at least correct output in all browsers, even if not absolutly identical.
| What | Technologies | Responsibilities | |
| GUI skinning | CSS1 CSS2 | positioning, coloring, font | |
| GUI interaction | DOM, JavaScript | form validation, interactivity, event handling | |
Related links
Internal
External
Dernièrement modifié par mytto
, Basé sur le travail de
rhum1
.
Modifiée dernièrement le lundi 30 de janvier, 2012 11h21m21.
