Java works with a variety of objects classified notes of O

In Java project which we always encounter a variety of different objects with the O's,

For a white, the usage scenarios often confuse these objects, so here mark and let your code more standardized, but this is where Java has been criticized, different business needs it to write a wide variety of mapping class.

PO: persistent object, persistent objects. Corresponding fields in the database table. PO are some of the attributes, as well as the composition of the set and get methods (using the powerful lombok plug-in is more convenient). Generally, a table corresponding to a PO.

VO: vlue object, also known as: presentation layer objects, but also can be considered a view object. For data transfer between the service layers, and PO as it only contains data. According to the needs of business, which fields, abstracted business objects business needs. For the page to display fields, a VO may be packaged, the data is encapsulated into a desired distal passed.

BO: bussiness object, the business object. Encapsulate business logic java object by calling DAO methods, combined PO, VO business operations. A PO BO object can include a plurality of objects. We are many such operations require a connection to the operating table, then this field may be needed by the business into a package BO, BO and the plurality of fields comprises a PO belongs.

DAO: data access object, data access objects. This object is used to access the database. DAO contains a method of operating the various databases. By its methods, PO binding to the database related operations. Caught in the middle of the business logic and database resources.

DTO: data trasfer object, a data transfer object. Mainly used for local transport objects requires a lot of long-distance calls, etc., corresponding to the DTO said above VO, DTO is for the back-end, front-end page is VO.

POJO: plain ordinary java object) simple random java object, pure traditional sense of java objects.

Guess you like

Origin www.cnblogs.com/mobingfeng/p/11547174.html