Difference between Transfer objects and Domain objects

  • DTOs don’t have any logic. They only have fields (state). They are used when transferring data from one layer/subsystem to another
  • Domain objects can have logic (depending on whether you are using domain-driven design or have anemic data model) and they are usually related to the database structure.

If using anemic data model (i.e. your domain objects don’t have any logic), DTO and domain object can be the same object.

Related: http://techblog.bozho.net/?p=427

Leave a Comment