Actually i'm pretty confused about this terms and how they relate to each other. A read something about every one of them but i don't uderstant the work flow..
DTO - Data transfer object - object to transport values
BO Business object - object in domain model. object to make Business logic with
POCO - no idea, i've read a definition on wiki but didn't understood anything
DAO - data access object - object to map the DB table ?
Could someone please bring some light into it for me ?
DTO — Data Transfer Object. DAO — Data Access Object. PO — Persistence Object. SO — Service Object. BO — Business Object.
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.
It is an Data Transfer object which used to pass the properties from service layer to persistence layer. DAO: It is an Data Access object. it is also known as persistence layer.
A data transfer object (DTO) is an object that carries data between processes. You can use this technique to facilitate communication between two systems (like an API and your server) without potentially exposing sensitive information.
So a regular workflow would be to request data from a service, which is sent to your app as a DTO, you convert it to a BO to manipulate it and send it back as a DTO or after converting it to a DAO store it in a database.
You use the different object to separate concerns between the 3 types, a BO doesn't need to know whether it's persisted using a database or a service.
Timeline based scaffolding:
Batch => Stored Procedure => "plain old clr object" => npmagenda
Socket => ODBC => "data access object" => NoSQL
CSV => XML => "data transfer object" => JSON
FTP => CGI => "business object" => AJAX
References
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With