Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DTO DAO POCO BO

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 ?

like image 983
user137348 Avatar asked Jul 29 '09 22:07

user137348


People also ask

What is DTO and BO?

DTO — Data Transfer Object. DAO — Data Access Object. PO — Persistence Object. SO — Service Object. BO — Business Object.

Is DAO and DTO same?

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.

What is DTO and DAO in spring boot?

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.

What DTO means?

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.


2 Answers

  • DTO: Data Transfer Object, used to transfer data between loosly coupled services
  • POCO: Plain Old Clr Object, normal CLR object doesn't use any attributes or required inheritance to act as a DAO/DTO
  • BO: Business Object, contains business logic, used in the Business Logic part of your solution
  • DAO: Data Access Object, used to transfer data from your database

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.

like image 106
Paul van Brenk Avatar answered Sep 20 '22 10:09

Paul van Brenk


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

  • How to schedule and automate backups of SQL Server databases in SQL Server Express
  • npmjs: agenda - Light weight job scheduler for Node.js
  • Corba, XML and ODBC
  • webdav by hand
  • Export MVC WebGrid to Excel (CSV)
  • Stored Procedure POCO Generator Utility for SQL Server
  • Technical Standard Systems Management: Data Storage Management (XDSM) API (pdf)
  • JVM to .Net Interop
like image 38
7 revs Avatar answered Sep 20 '22 10:09

7 revs