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

anti-patternsdata-transfer-objectsdtoejbjava

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

Why? What are the alternatives?

Best Answer

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.