Java VO \ PO \ DAO \ BO details, vobo

Source: Internet
Author: User

Java VO \ PO \ DAO \ BO details, vobo

VO value object \ PO Persistent object, which consists of a set of properties and the get \ set Method of the properties.

Full-process persistence object of PO

The most vivid understanding is that a PO is a record in the database and can be seen as a java object that is mapped to a table in the database.

The advantage is that a record can be processed as an object, which can be easily converted to other objects.

BO is called a business object.

It is mainly to encapsulate the business logic as an object, which can include one or more other objects for data transmission between the business layer.

Create a BO object to process the resume. This BO can contain an educational experience PO, a job manager PO, and a social relationship PO.

VO stands for objects.

It mainly corresponds to the Data Objects displayed on the interface.

DAO full name Data Access Object

It is mainly used to access databases. DAO contains various database operation methods and provides interfaces for the business layer.

ActionForm in Struts is VO.

The Entity bean in Hibernate is PO.

Some Supplements to JPA: the complete JPA requires the object class, namely, the persistence. xml configuration file in the META-INF under the PO + DAO (Interface) \ Service (interface implementation) + src
What are the representative of vo bo po?

VO (value object) value object
It is usually used for data transmission between business layers. Like PO, it only contains data. However, it should be an abstract business object, which can correspond to a table or not. This is based on the business needs. I personally think it is the same as DTO (data transmission object) and transmitted on the web.

BO (business object) business object
From the business model perspective, see the domain objects in the UML component domain model. Java objects that encapsulate the business logic, and perform business operations by calling the DAO method and combining PO and VO.

PO (persistant object) Persistent object
The concept that appears during o/r ing. If there is no o/r ing, this concept does not exist. Usually it corresponds to the data model (database), and some business logic is processed. It can be viewed as a java object mapped to a table in the database. The simplest PO is to correspond to a record in a table in the database. A set of PO can be used for multiple records. The PO should not contain any operations on the database.

Conversion of vo and po in java

This depends on how you want to use it.
Not OO does not mean it is not object-oriented.
Object-oriented does not have to be OO
You can use PO as VO because it is easy to use PO directly in some small programs that are not easy to change.
There is no standard boundary. norms are norms, but do not block your own ideas.

However, I still separate them to say that it is just for loose coupling.
There are also VO to BO to PO
Different

In DAO, I think it should be for PO. Otherwise, isn't it equivalent to setting a global variable?
This will change the reuse rate to 0.
I have not studied the specific rules and regulations carefully.

My framework is to call the PO inheritance interface when implementing the DAO interface.
IDAO:
Public interface IBjglsxDao extends BaseIface {
// Query by Glsxlxh
Public abstract Object queryForGlsxlxh (Object object Object );
}
DAO:
Public class BjglsxDao extends BaseDao implements IBjglsxDao {

Public BjglsxDao (DaoManager arg0 ){
Super (arg0 );
// TODO Auto-generated constructor stub
}
Public Object queryForGlsxlxh (Object object Object ){
// TODO Auto-generated method stub
Return queryForList ("jxgl_bjglsx_selectForGlsxlxhForList", object );
}
}

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.