Tomas Johansson's blog

10/08/07

Encapsulate your classes and avoid exposing references to mutable private fields

Filed under: Software design — admin @ 01:56:36 am

This posting discusses the (too unknown) concept of encapsulating data. When a private field is mutable, you will not achieve much encapsulation if you provide a public accessor returning a direct reference to the data that you declared as private.

powered by  b2evolution Credits: blog skins | blog software | web hosting | monetize
This skin features a CSS file originally designed for WordPress (See design credits in style.css).