Talk:Do Not Expose More Than You Want

From APIDesign

Revision as of 05:43, 14 June 2008 by Apidesign (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Fixed: f4219513dece

Regarding "public static final constants":

  1. These are not constants at all if the type is neither primitive nor String. Definitely avoid nonconstant fields, even if static and final.
    1. Why you think public static final Object CONST_EMPTY = new Object(); is not constant?
  2. True constants can also be problematic because, as mentioned in a previous chapter, the value is inlined into the caller and so cannot ever be changed.
  3. Java 5 enumerations should be encouraged where the value is arbitrary. A constant is appropriate if the value is independently motivated.

--JesseGlick 00:14, 8 April 2008 (UTC)

  1. Page 71: The anecdote about the performance of compiled versus interpreted code is duplicted from a previous chapter. It should exist in one place or the other, but not both.

--TomWheeler Sat Apr 12 19:13:37 CDT 2008

Personal tools
buy