Layers architecture for J2EE Applications




Reviewing the software system architecture, layers of an application are separated logic parts that belong to the application. The same layers stands also in the J2EE Application. The description of layers, now taking into consideration the web components from J2EE platform, is presented below:
o Presentation layer: This layer is made up of Java Server Pages (JSP) which are basically HTML files with special tags having Java codes to provide dynamic content to the clients. Java Server Pages run on a Web server in a JSP servlet engine. JSP codes the presentation logic and takes care of client HTTP sessions, which contains the information about clients sending requests to the Web server.
o Business logic layer: JavaBeans are the core of Business Logic Layer. JavaBeans bring component technology to the Java platform. With the JavaBeans API, one can create reusable, platform-independent components. The purpose of JavaBeans in our architecture is to code business logic in them. Business logic is the implementation of various processes of an enterprise. Nevertheless, the Business Logic is included also in stored procedures in Data Base servers



o Data access logic layer: The Data Access Logic Layer is composed of simple Java classes known as Data Access Objects (DAO). This layer is provided to separate the business logic and data access logic. DAO is used to communicate with the database and to sends request to it. In other words, DAO manages the connection with the data source to obtain and store data. The answer to the presentation layer can be a list of Data Transaction Objects (DTO) Data is retrieved from database, bundled in proper Java objects, and sent back to JavaBeans for implementing business logic.