2017  Kodetalk | Feedback | Privacy Policy | Terms | About

When we use the pojo,dto,actionform

I Have confusion when to pojo,dto,actionform in struts.

DTO(data transfer object), its also called value object(VO).

While transferring multiple values from one layer to another layer, instead of transferring them one-by-one for multiple times. It is recommended to combine all these values into a single java class object and send that object from source layer to destination layer. This reduces the roundtrips between layers. In this process the class of that single object is called as V.O class/D.T.O class.
In  struts  application  the  multiple  values  of  form  page  that  comes  to ActionServlet (controller layer will go to struts Action class as single object data of FormBean class. So, FormBean class in struts application is called as V.O class or D.T.O class.

FormBean class object is visible in struts Action class as the parameter of execute (-,-,-,-) method.

POJO(plain ordinary java object )

We can also say its a persistence object.Its not a special object, and in particular not an Enterprise JavaBean.

Values from Java class attributes and persist them to a database table. A mapping document helps Hibernate in determining how to pull the values from the classes and map them with table and associated fields.

Our flow like this from  UI to data Formbean --->DTO----->POJO ,map the pojo attributes to hibernate mapping attributes to DB columns, and store them in data base.For fetching data  from data base in reverse way POJO --->DTO----->Formbean.

Answer is