Oh No! DTO! Should DTOs

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

[via Artima Weblogs]

 

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.”

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.

Print This Post Print This Post
blog comments powered by Disqus
Creative Commons Attribution 3.0 Unported
This work is licensed under a Creative Commons Attribution 3.0 Unported.