[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jfriends-ml 12067] Re: 「 Java 2 Standard Edition 5.0 Tiger 」を 読む会第1回議事録



  高橋(智)です。

"TAKAHASHI, Tomohiro" wrote:
snip 
>    - 1.2.1の命名規約の出典はどこだろう?→宿題
snip

  [E vs T]
    http://forum.java.sun.com/thread.jspa?forumID=316&threadID=493930
を見ると
  ----- 引用 -------------------------------------------------
  The generics tutorial mentions naming conventions briefly:
  http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
  ----- 引用 -------------------------------------------------
とあります。

  で、見てみると、
  ----- 引用 -------------------------------------------------
  A note on naming conventions. We recommend that you use pithy (single
  character if possible) yet evocative names for formal type parameters.
  It’s best to avoid lower case characters in those names, making it easy
  to distinguish formal type parameters from ordinary classes and interfaces.
  Many container types use E, for element, as in the examples above. We'll
  see some additional conventions in later examples.
  ...
  ...
  ...
  Again, note the naming convention for formal type parameters - K for keys
  and V for values.
  ...
  ...
  ...
  Finally, again let's take note of the naming convention used for the type
  parame-ters. We use T for type, whenever there isn't anything more specific
  about the type to distinguish it. This is often the case in generic methods.
  If there are multiple type parameters, we might use letters that neighbor T
  in the alphabet, such as S. If a generic method appears inside a generic
  class, it's a good idea to avoid using the same names for the type parameters
  of the method and class, to avoid confusion. The same applies to nested
  generic classes.
  ...
  ----- 引用 -------------------------------------------------
とありました。
  他(仕様書など)にも書かれているのでしょうか??

-- 
高橋智宏
  Java読書会( http://www.javareading.com/bof/ )