Javatpoint Logo

what is the difference between DAO and DTO files.....?????

By: ritesh*** On: Mon Apr 22 11:32:50 IST 2013     Question Reputation6 Answer Reputation0 Quiz Belt Series Points0  6Blank User
I want the full description with examples

kindly not paste the answer from google....
Up3Down

 
Data Access Object (DAO)
Data Transfer Object (DTO).

-------------------------------
DAO is a class that usually has operations like save, update, delete. Whereas the DTO is just an object that holds data.


-------------------------------
The advantage of the DAO layer is that if you need to change the underlying persistence mechanism you only have to change the DAO layer, and not all the places in the domain logic where the DAO layer is used from.

The advantage of DTO layer is that it adds a good deal of flexibility to the service layer and subsequently to the design of the entire application

Image Created5Down

By: [email protected] On: Mon Apr 22 11:56:09 IST 2013 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :7Yes2No
 
DAO is a class that usually has the CRUD operations like save, update, delete. DTO is just an object that holds data. It is JavaBean with instance variables and setter and getters.

The DTO is used to expose several values in a bean like fashion. This provides a light-weight mechanism to transfer values over a network or between different application tiers.
DTO will be passed as value object to DAO layer and DAO layer will use this object to persist data using its CRUD operation methods.
Image Created3Down

By: [email protected] On: Mon Apr 22 12:03:54 IST 2013 Question Reputation0 Answer Reputation147 Belt Series Points0 147User Image
Are You Satisfied :4Yes3No
 
kindly Elaborate it with an exampleImage Created0Down

By: [email protected] On: Mon Apr 22 12:09:34 IST 2013 Question Reputation6 Answer Reputation0 Belt Series Points0 6User Image
Are You Satisfied :1Yes3No
 
Image Created0Down

By: [email protected] On: Tue Nov 27 15:32:58 IST 2018 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No