...
Wiki Markup |
---|
*EX2:* "if a class is package-private or is a private nested class, there is nothing inherently wrong with exposing its data fields - assumngassuming they do an adequate job of describing the abstraction provided by the class. This approach generates less visual clutter than the accessor-method approach, both in the class definition and in the client code that uses it." \[[Bloch 08|AA. Java References#Bloch 08]\]. This exception applies to both mutable as well as immutable fields. |
...