PO: persistent object , po (persistent object) is the Entity in the Object/Relation Mapping framework, and each attribute of po basically corresponds to a field in the database table. It is a pure Java object that conforms to the Java Bean specification, without adding other properties and methods. Persistent objects are created by insert database and deleted by database delete. Basically persistent object life cycle and database are closely related.
VO: Value Object , usually used for data transfer between business layers. Like PO, it only contains data. But it should be an abstracted business object, which can correspond to a table or not, depending on the needs of the business.
The presentation layer object (View Object) mainly corresponds to the data object displayed on the display interface, and a VO object is used to encapsulate the object data required for the entire interface display.
BO: Abbreviation for business object layer (Business Object) , a java object that encapsulates business logic, and performs business operations in combination with PO and VO by calling DAO methods. You can see an example online:
For example, a resume, with educational experience, work experience, social relations, etc.
We can map educational experience to a PO, work experience to a PO, and social relationships to a PO.
Create a BO object corresponding to the resume to process the resume, and each BO contains these POs.
When dealing with business logic in this way, we can deal with BO.
DTO: Data Transfer Object is a software application system for transferring data between design patterns. The data transfer target is often a data access object to retrieve data from a database. The difference between a data transfer object and a data interaction object or data access object is that one does not have any behavior other than storing and retrieving data (accessors and accessors). To put it simply, when we need the content of an object with 10 fields, but this object has a total of 20 fields, we do not need to transfer all the fields of the entire PO object to the client, but can repackage it with DTO and pass it to the client . At this time, if this object is used to display the corresponding interface, it is called VO.
JavaBean: A reusable component , that is, "write once, execute anywhere, reuse anywhere". Satisfies three conditions: ① the class must be concrete and public ② has a no-argument constructor ③ provides a public method consistent with the design pattern to expose the member properties of the internal field.
Main usage: Can be used in functions, processes, values, database access, and JSPs for any object that can be created with Java code.
There are two kinds: one is a JavaBean with a user interface (UI, User Interface); the other is a JavaBean without a user interface, which is mainly responsible for processing transactions (such as data operations , manipulating databases). JSP usually access is the latter JavaBean.
Classification: There are usually three categories: Session bean, Entity bean, and MessageDrivenBean
JavaBeans:JavaBeans 从狭义来说,指的是 JavaBeans 规范也就是位于 java.beans 包中的一组 API。从广义上来说,JavaBeans 指的是 API 集合,比如 Enterprise JavaBeans。
POJO:POJO(Plain Ordinary Java Object)简单的Java对象,实际就是普通JavaBeans,是为了避免和EJB混淆所创造的简称。通指没有使用Entity Beans的普通java对象,可以把POJO作为支持业务逻辑的协助类。
直接用来对应表示层就是VO