views:

540

answers:

1
+3  Q: 

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 ?

+9  A: 

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 send 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.

pb
Well said. Brief, but effective.
Kevin Swiber
The only thing what I miss, is what to do, if you BO logic needs to load data? How can it access the DAO?
pihentagy