27

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 ?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
user137348
  • 10,166
  • 18
  • 69
  • 89

2 Answers2

39
  • 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.

Sam R.
  • 16,027
  • 12
  • 69
  • 122
Paul van Brenk
  • 7,450
  • 2
  • 33
  • 38
3

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

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265