About Me

我的相片
Mr. Pigg
Taipei, Taiwan
檢視我的完整簡介

星期一, 8月 11, 2008

Effective Java - Chapter 6 Enums & Annotations

  1. Use enums instead of int constants
    - instance controlled
    - a generalization of singletons
    - 可提供各種物件化的programming
    - enum的method多被為private or package private
    - constant-specific method implementations
    - strategy enum pattern
    - valueOf, toString(), fromString()
  2. Use EnumSet, EnumMap
  3. Annotation
    - Retention
    - Target
    - Parameter
  4. Override
  5. Mark interface

0 意見: