You get a text: java in VO, PO, BO, DAO, POJO

For java projects in various objects with O, analyze, understand their respective roles.

PO: persistent object, persistent objects. One correspondence with the field in the database table. PO is a number of attributes and methods set and get the composition. Generally, a table corresponding to a PO. Crud is directly related to the operation of the database.

VO: vlue object, also known as: presentation layer object, that view object. Typically for data transfer between the service layers, and PO it is as it only contains data. But it should be an abstract of a business object, and the table may correspond to, or may not, based on business needs it. For the objects on the page to be displayed, a VO may be packaged object into the desired package data.

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. Common examples of such resume work, for example, can be understood as a resume BO, resume also includes work experience, learning experiences, these can be understood as one of the PO, PO composed of a plurality of BO.

DAO: data access object, data access objects. This object is used to access the database. PO usually used in combination, DAO contains a method for 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 and so on.

For example, we have 100 fields in a table, then the corresponding PO have 100 properties. However, we only show the interface 10 fields, with the WEB service client to retrieve the data, there is no need to pass the entire client objects PO,

Then we can use these DTO only 10 properties to deliver results to the client, so it will not expose the server table structure. After reaching the client, if this object to the corresponding screen display, that at this time it's identity He turned VO.

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

Guess you like

Origin www.cnblogs.com/shilei-ysl/p/11032304.html