The difference between PO BO Vo and __java

Source: Internet
Author: User

1, PO, persistence object, persistent Layer objects, object properties and database table of the field one by one corresponding;
2, BO, Business object, Business Layer objects, object properties and the current business logic required by the name of the data one by one corresponding;
3, VO, View object, Performance Layer objects, object properties and the name of the data displayed on the page one by one corresponding;
4, POJO, Plain ordinary Java object, normal Java objects, only attributes and their set/get methods. Note:

     (1) The PO is created when new data is added to the database, deleted when the data is deleted from the database, can only survive in a database connection, the disconnect is destroyed, and the Po object needs to implement serialization excuses.
      (2) BO, Vo, and Pojo are created by the New keyword and are recycled by GC, which always exists as long as it is not recycled.

Po bo Vo has very similar properties, and when used at an irregular level, it is often converted to each other.

Beanutils.copyproperties () can be used to simplify the conversion between three objects in Po bo vo. Note:

If a property with a different name exists between user and Useractionform, the beanutils does not process the properties and needs to be handled manually. For example:

There is a CreateDate creation time field inside the user class, and Useractionform does not have this field in it. Beanutils.copyproperties () does not perform any processing on this field. You must manually handle it yourself.

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.