Original Address:several objects of Java (Po,vo,dao,bo,pojo) explained
Munandong
One, Po:persistant object persistent objects, can be seen as a Java object mapped to a table in the database. The simplest PO is a record in a table in the corresponding database, and multiple records can be used with a collection of PO. The PO should not contain any operations on the database.
Two, Vo:value object value objects. Typically used for data transfer between business tiers, as is the case with PO, which contains only data. But it should be abstracted out of the business object that can correspond to the table, or not, depending on the needs of the business. Personally feel the same DTO (data transfer object) that is passed on the web.
Third, Dao:data Access object, which is used to access the database. Usually used in conjunction with PO, DAO contains various methods of operation of the database. Through its method, combine the PO to carry on the related operation to the database.
Four, Bo:business object Business objects, encapsulates the business logic of the Java object, by invoking the DAO method, combined with PO,VO for business operations.
V, Pojo:plain ordinary Java object Simple and irregular Java objects, I personally think it and the other is not a level of things, Vo and Po should belong to it.
Po:persistant object The most vivid understanding of persistent objects is that a PO is a record in the database. The advantage is that a record can be processed as an object and can be easily converted to other objects.
The main purpose of Bo:business object business objects is to encapsulate the business logic as an object. This object can include one or more other objects. such as a resume, educational experience, work experience, relationships and so on. We can have an education experience corresponding to a PO, the work experience corresponds to a PO, the relationship corresponds to a PO. Create a CV-based Bo object to process resumes, each BO containing these po. When we handle business logic like this, we can deal with Bo.
Vo:value Object-Valued objects viewobject the data objects that are displayed in the main interface of the presentation layer object. For a Web page, or an interface for SWT and swing, use a Vo object to correspond to the value of the entire interface.
Dto:data Transfer Object Data transfer objects are mainly used for remote calls and other places where large numbers of objects need to be transferred. For example, if we have 100 fields in a table, then the corresponding PO has 100 attributes. However, as long as we display 10 fields on the interface, the client uses the Web service to fetch the data, and there is no need to pass the entire PO object to the client, we can pass the result to the client with a DTO with only these 10 attributes. This also does not expose the service-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
Pojo:plain ordinary Java object Simple Java objects personal feeling POJO is the most common and changeable object, is an intermediate object, is also our most frequently dealing with objects. A Pojo persistence is the PO directly with it to pass, the process is the DTO directly used to correspond to the presentation layer is VO
Dao:data Access Object data Access objects This is most familiar to everyone, and the above several o the biggest difference, basically without the possibility and necessity of mutual transformation. Primarily used to encapsulate access to a database. It can be pojo to the PO, with PO assembled VO, DTO
[Po,vo,dao,bo,pojo] Interpretation of several objects reproduced]java