Model, Orm,dao,service, persistence layer, MVC concepts of these nouns in Java?

Source: Internet
Author: User

These concepts are not specific to a particular programming language.

View layer: Combines the control layer to display the foreground page.

Control layer: The Business module process controls, invoking the service layer interface.

Service layer: A business Operation implementation class that invokes the DAO layer interface.

DAO Layer: Data Service processing, persistent operation

Model layer: Pojo,or maping, persistent layer

Borrow someone a picture, hope the Lord can clarify the relationship between the layers:

Enterprise application development, the system can be divided into three layers: the presentation layer, the business layer, the persistence layer, is the so-called three-tier architecture. Each of the three layers has its own architectural model. Among them, the common architecture of the presentation layer is MVC, and the business layer common architecture pattern is divided into Transaction script mode and domain model mode, and the persistence layer architecture pattern has the entrance, data Mapper and so on.

The so-called MVC is an architectural pattern of the presentation layer. MVC is divided into three parts of model, view, controller. A lot of online information, you have a look.

The transactional scripting schema pattern is one of the business layer architecture patterns and is ideal for use in situations where business logic is simple and the team's object-oriented capabilities are insufficient. Transactional scripting patterns are a way of organizing business logic in which business logic consists of the business object Pojo of service+dao+ anemia. The service encapsulates the request for the layer, and each request is encapsulated into a method of the service class. Access to the persistence layer passes through the DAO. Business objects are represented by Pojo, these pojo are only attributes, no methods, and therefore are called anemia domain objects.

The persistence layer is responsible for persisting business objects in the business layer into the database. ORM, an object/relational data mapper, Hibernate is an ORM. ORM encapsulates access to a database, directly mapping objects to a database, so programmers don't spend a lot of time writing JDBC access to the database's code.

To familiarize yourself with these concepts, it is recommended that you look at two books, one on Enterprise Application architecture (Martin flower, the master's work) and one in "POJOs in Action" (with Chinese translation).

Model, Orm,dao,service, persistence layer, MVC concepts of these nouns in Java?

Related Article

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.