Michael Long
Jun 24, 2021

--

Please illustrate how, by using a DTO, you can prevent an entire [MyType] from failing to decode when it has a missing required field?

At any rate, I never said that that was never a use case for a DTO. But like pretty much everything, it comes down to whether or not the benefits outweight the addtional complexity and code.

If you're creating DTOs for everything in an app by rote, then I'd ask why.

--

--

Michael Long
Michael Long

Written by Michael Long

I write about Apple, Swift, and SwiftUI in particular, and technology in general. I'm also a Lead iOS Engineer at InRhythm, a modern digital consulting firm.

Responses (1)