Why are data transfer objects (DTOs) an anti-pattern?

ntownsend picture ntownsend · Sep 17, 2009 · Viewed 57.4k times · Source

I've recently overheard people saying that data transfer objects (DTOs) are an anti-pattern.

Why? What are the alternatives?

Answer

KLE picture KLE · Sep 17, 2009

Some projects have all data twice. Once as domain objects, and once as data transfer objects.

This duplication has a huge cost, so the architecture needs to get a huge benefit from this separation to be worth it.