26 February 2009

Application Layers

Today I want to talk About an important Programming concept, Application Layers.

All of us know that there might be in your layered application some common layers such as Database layer, Business layer and Presentation layer, but most of us do not exactly know the responsibility of each layer, so lets talk about Layers in our Layered Applications.

In any modern J2EE ( and non-Java ) layered application we have Four layers in our applications, three in our programming code and one outside it, it represented in the Database.

These layers are ( from top to bottom ) Presentation layer, Business layer and Integration layer .

We will define each layer and give common technologies used to implemented that layer.


Presentation Layer :

presentation layer is the layer that the end-user sees and interacts with, this is mostly implemented as Web Interface or Desktop interface or even as Mobile-application interface.

Common technologies:

mostly the presentation layer implemented in JSF, Struts, Oracle ADF, Apache Coccon, JSP/Servlet for Web-based presentation layers and Swing, AWT for Desktop-based presentation layers

Business Layer :

The business Layer ( also known as Application Layer )  is the most important layer in your application, it represents the core application modules implemented, the more clearer and design patterns involved, the best your application in both flexibility and ability to be maintained on the long run.

Mostly implemented in your native Java code as Objects that represents your domain business model or in Large applications,  it is implemented as EJB Session Beans and MDBs.

Again, this layer is the most important one cause it decides whether you application design and coding is good or bad.

It depends on the developers experience in solving business problems.

Integration Layer :

Also known as Data Access Layer, It is the layer responsible for getting the data back and forth from and to the database.

It is mainly responsible for Making data access processes for you Business layer also it makes your application independent from the underlaying database technology.

Common technologies:

Also many developers implement this layer using regular JDBC code, there are many frameworks and technologies found in this area, for frameworks there are Hibernate, Oracle Toplink, iBATS and OJB that is an implementation for JDO technology.

In this layer there is a common Design patten arise in J2EE applications that make the implementation of this layer an easy and organized task , that is DAO pattern (Data Access Objects). ( see this post for more info about DAO pattern)

The last layer is the Database layer that stores the data of your applications, also there are many DBMS found as Oracle Database, MySQL, HSQL, the windows-only MS SQL Server and many more.

No comments: