Oh No! DTO! Should DTOs

Oh No! DTO! Should DTOs have public variables? Or should they have private variables with getters and setters?


Finally someone with a little sense on the subject. Notice that this fits in with the idea of “accessors considered harmful“. (Which, just for the record, I noted before Holub)

A final observation by Dave Astels: “Sometimes a data structure is just a data structure.”

About Johannes Brodwall

Johannes is Principal Software Engineer in SopraSteria. In his spare time he likes to coach teams and developers on better coding, collaboration, planning and product understanding.
This entry was posted in Software Development. Bookmark the permalink.