"Java ee": A layered model for application of __java

Source: Internet
Author: User
Tags object object

Today, we are talking about Java EE applications, often beyond the Sun's classic Java EE Application Specification, but a broader development specification.

Classic Java EE applications are often based on EJB (Enterprise-class Java beans) as the core, the application server for the operating environment, so often the cost of development and operation is relatively high.

And now the more popular lightweight Java EE applications in the market have a variety of features of the Java EE specification, such as object-oriented modeling ideas, excellent application tiering and good scalability, maintainability. Lightweight Java EE applications retain the architecture of classic java-based applications, but the cost of development and operation is greatly reduced.


Both the classic Java EE architecture and the lightweight Java EE Architecture, the essence of the idea is the same, that we have all heard of layered thinking, the two architectural patterns can be broadly divided into the following layers.


domainobject Layer:


This layer is composed of a series of Pojo (Plain Oldjava object, the ordinary, traditional Java objects), which are domain object of the system and often contain the business logic methods that they need to implement.


DAO (data AccessObject) layer:


This layer consists of a series of DAO components that implement atomic operations such as creating, querying, updating, and Deleting (CRUD) the database.


In classic Java EE applications, the DAO layer is also called the EAO layer, and the role of the EAO layer component is essentially similar to that of the DAO layer component. Only the EAO layer completes the CRUD operations on the entity (Entity), so it is referred to as the EAO layer.


business Logic Layer:


This layer consists of a series of business logic objects that implement the business logic methods required by the system. These business logic methods may be used only to expose the business logic methods implemented by the domain object object or the business logic method that relies on the DAO component implementations.


Controller layer:


This layer is composed of a series of controllers that block the user's request and invoke the business logic method of the business logic component, process the user request, and forward to the different presentation layer components based on the processing result.


Presentation layer:


This layer consists of a series of JSP pages, velocity pages, and PDF document view components that collect user requests and display the processing results.


In general, the architecture of lightweight Java EE applications is shown in the following illustration:


The various layers of Java EE components are coupled in a loosely coupled manner, and the components are not coupled in a hard-coded fashion, in response to future expansion requirements. From the top down, the implementation of the above component depends on the functionality of the following components, from the bottom up, the following components support the implementation of the above components.


The structure of the classic Java EE application with the EJB/JPA core is roughly similar to the structure in the previous illustration, except that its DAO layer and business logic components are both represented by EJB components. Its architectural chart is as follows:


Summary :

        computer programming in the early stages, our program is not layered this said, are chaotic, such a system maintenance is quite laborious, and code reading is extremely uncomfortable. Technology has developed today, no matter how massive the system is, layered thinking has been deeply rooted, because our software system in the use of the process, there will always be new requirements or changes, so that the original design system architecture, the use of layered model to build their own system is a choice. So after applying tiering, what technologies or components are used to support each level. Please listen to let's.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.