3 ms·
Worth reading. DTOs are an example of class myopia that is all too present in the Java world. really, you don't need to invent a class for a bunch of data. Th
by russell 18y ago
Worth reading. DTOs are an example of class myopia that is all too present in the Java world. really, you don't need to invent a class for a bunch of data. The DTO doesn't do anything except pass a bunch from one component to another. It doesn't have any inherent functionality. Worse yet, it is a tight coupling between the the components in an MVC pattern. If you change the model, you are forced to change the DTO. If uou delete a field from the DTO, you have probably broken the view. It is much better to use a HashMap or JSON as a data transfer. It's much less fragile.