Why are data transfer objects (DTOs) an anti-pattern?
问题 I\'ve recently overheard people saying that data transfer objects (DTOs) are an anti-pattern . Why? What are the alternatives? 回答1: 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. 回答2: DTOs are not an anti-pattern. When you're sending some data across the wire (say, to an web page in an Ajax call), you want to be sure that you