▲ | mattmanser 4 days ago | |
It's a pattern that rapidly leads to tons of DTOs that endlessly repeat exactly the same properties. Your example doesn't even justify it's use, in that scenario the small form is actually a completely different object from the User object, a UserSignup. That's both conceptually different and practically different to an actual User. The worst pattern is when programmers combine these useless DTOs with some sort of auto mapper, which results in huge globs of boilerplate making any trivial changes to data definitions a multi file job. The worst one I've seen was when to add one property I had to edit 40 files. I get why people do it, but if you make it a pattern it's a massive drag to development velocity. It's anti-patterns like that which give statically typed languages a bad name. You should really only use it when you really, really need to. |