Po:persistent Object Persistent Objects
1. Sometimes also known as the data object, the corresponding entity in the database, you can simply think of a PO corresponding to a record in the database.
2. The Hibernate persistence Framework is closely related to insert/delet operations.
3. The PO should not contain any operations on the database.
---------------------------------------------------------
Pojo:plain ordinary Java Object Rules-free simple Java objects
An intermediate object that can be converted to PO, DTO, VO.
1. Pojo after persistence ==〉po
(During the run time, converting Pojo to Po,po from Hibernate's cglib dynamically adds some properties and methods to manage the database entity state relative to the Pojo.) PO is completely transparent to programmer, because it is a run-time build PO, it can support incremental compilation, incremental debugging. )
2. Pojo during transmission ==〉dto
3. Pojo as the presentation layer ==〉vo
Both PO and VO should belong to it.
----------------------------------------------------------
Bo:business Object Business Objects
Encapsulating the business logic as an object (which can include multiple po, usually need to convert Bo to Po, in order to persist the data, instead, the PO obtained from the DB needs to be converted into Bo to be used at the business layer).
There are three main concepts about BO
1. Contains only the properties of the business object;
2, only include business methods;
3, both are included.
In actual use, it is not important to think which concept is correct, and the key is to fit the needs of the project in practical application.
----------------------------------------------------------
Vo:value object/View Object Presentation Layer Object
1. A data object that mainly corresponds to the page display (Web page/SWT, swing interface).
2. can be corresponding to the table, or not, depending on the needs of the business.
Note: In struts, use Actionform to do Vo, need to do a conversion, because PO is object-oriented, and Actionform is the corresponding to the view, a few PO to display the properties of a actionform to be synthesized, You can use the Copy method of Beanutils.
----------------------------------------------------------
DTO (TO): Data Transfer Object Data transfer objects
1. It should not contain business logic when it needs to be transferred across processes or remotely.
2. For example, if a table has 100 fields, the corresponding PO has 100 attributes (in most cases, the data from the DTO comes from multiple tables). However, the view layer only needs to display 10 fields, there is no need to pass the entire PO object to the client, then we can use only these 10 attributes of the DTO to transfer data to the client, which will not expose the server side table structure. After reaching the client, if the object is used to display the corresponding interface, then its identity will be converted to VO.
----------------------------------------------------------
Dao:data Access Object Data
1. Primarily used to encapsulate access to the DB (Crud operations).
2. The Pojo is persisted to PO by receiving data from the business layer.
Daoimpl is the implementation of the DAO interface class, useful for multi-database projects, if the project must have been only a platform of the database, with no matter, in addition to DAO, can also encapsulate the access to non-relational database, such as mail system, file system.
Acquisition
JSP PO VO BO DTO POJO DAO explanation