Implementation Patterns と Smalltalk Best Practice Patterns の類似・相違項目一覧


Implementation … と SBPP とで共通・類似の内容の項目には「●」、Implementation … で新しく追加された項目には「△」、SBPP のみの項目には「▽」をそれぞれ冠してあります。あと、この機会に SBPP のことを知った Ruby な方々向けの参考までに「▽」な項目については、Ruby に関連ありそうな項目に [Ruby] ラベルを付してみました。


クラス

△ Class
● Simple Superclass Name
● Qualified Subclass Name
△ Abstract Interface
△ Interface
△ Abstract Class
△ Versioned Interface
△ Value Object
△ Specialization
△ Subclass
△ Implementor
△ Inner Class
△ Instance-Specific Behavior
△ Conditional
● Delegation (SBPP: Delegation, Simple Delegation, Self Delegation)
● Pluggable Selector (SBPP: Pluggable Behavior, Pluggable Selector)
△ Anonymous Inner Class
△ Library Class
▽ Pluggable Block [Ruby]

状態

△ State
△ Access
● Direct Access (SBPP: Direct Variable Access)
● Indirect Access (SBPP: Indirect Variable Access)
● Common State
● Variable State
△ Extrinsic State
△ Variable
● Local Variable (SBPP: Temporary Variable)
 ●Collector/Count (SBPP: Collecting Temporary Variable)
 ●Explaining (SBPP: Explaining Temporary Variable)
 ●Reuse (SBPP: Reusing Temporary Variable)
 △Element
 ▽(SBPP: Caching Temporary Variable) [Ruby]
△ Field
△ Parameter
● Collecting Parameter
△ Optional Parameter
△ Var Args
△ Parameter Object
● Constant (SBPP: Constant Method)
● Role-Suggesting Name (SBPP: Role Suggesting Variable Name)
△ Declared Type
△ Initialization
● Eager Initialization (SBPP: Explicit Initialization)
● Lazy Initialization
△ Control Flow
△ Main Flow

メッセージ

● Message
● Choosing Message
● Double Dispatch
● Decomposing (Sequencing) Message (SBPP: Decomposing Message)
● Reversing Message (SBPP: Reversing Method)
△ Inviting Message
△ Explaining Message
△ Exceptional Flow
● Guard Clause
△ Exception
△ Checked Exceptions
△ Exception Propagation
▽ Dispatched Interpretation [Ruby]
▽ Mediating Protocol [Ruby]
▽ Super
▽ Extending Super
▽ Modifying Super

メソッド

● Composed Method
● Intention-Revealing Name (SBPP: Intention Revealing Selector)
△ Method Visibility
● Method Object
△ Overridden Method
△ Overloaded Method
△ Method Return Type
● Method Comment
● Helper Method (SBPP: Intention Revealing Message)
● Debug Print Method
● Conversion
● Conversion Method (SBPP: Converter Method)
● Conversion Constructor (SBPP: Converter Constructor Method)
● Creation (SBPP: Constructor Method)
● Complete Constructor (SBPP: Constructor Parameter Method)
● Factory Method (SBPP: Constructor Parameter Method)
△ Internal Factory
● Collection Access Method (SBPP: Collection Accessor Method)
● Boolean Setting Method (SBPP: Boolean Property Setting Method)
● Query Method
● Getting Method
● Setting Method
● Safe Copy (SBPP: Enumeration Method)
▽ Default Value Method [Ruby]
▽ Shortcut Constructor Method [Ruby]
▽ Comparing Method [Ruby (#<=>)]
▽ Execute Around Method [Ruby]

修正:
△ Safe Copy → ● Safe Copy (SBPP: Enumeration Method)

コレクション

● Array
△ Iterable
● Collection
△ List
● Set
△ SortedSet
● Map (SBPP: Dictionary)
▽ OrderedCollection
▽ RunArray
▽ Equality Method [Ruby (#eql?)]
▽ Hashing Method [Ruby]
▽ SortedCollection
▽ ByteArray
▽ Interval [Ruby (Range)]
▽ IsEmpty [Ruby (#empty?)]
▽ Includes: [Ruby (#include)]
▽ Concatenation [Ruby (#+)]
▽ Enumeration [Ruby]
▽ Do [Ruby (#each)]
▽ Collect [Ruby]
▽ Select/Reject [Ruby]
▽ Detect [Ruby]
▽ Inject:into: [Ruby (#inject)]
▽ Duplicate Removing Set → [Ruby #uniq]
▽ Temporarily Sorted Collection → [Ruby #sort / #sort_by]
▽ Stack [Ruby (Array #push, #pop, #last, #size, #empty?)]
▽ Queue [Ruby (Array #unshift, #shift, #empty?, #size)]
▽ Searching Literal [Ruby] or → [Ruby (case-when)]
▽ Lookup Cache [Ruby (cache[key]||=val)]
▽ Parsing Stream
▽ Concatenation Stream → [Ruby #<<]

(SBPP: フォーマット)

▽ Inline Message Pattern
▽ Type Suggesting Parameter Name [Ruby]
▽ Indented Control Flow
▽ Rectangular Block
▽ Conditional Expresstion [Ruby]
▽ Simaple Enumeration Parameter
▽ Cascade
▽ Yourself
▽ Interesting Return Value [Ruby]

まだ比較のために拾い読みした程度ですが、現時点での印象では、説明や例を端折ることはあっても、とくに SBPP の内容を古びさせるようなことが書いてあるわけではないので、“21 世紀の…”というよりは、Smalltalk コードでは意図を読みとりにくいと感じる人の向け & Java(静的型言語)に特化した内容を追補しつつちょっとスリムにした“気軽に読めるハンドブック版の SBPP ”…というような感じで、個人的にはとらえているところです。


加えて、Implementation … ではごっそり省かれてしまった項目に Ruby で応用がききそうなものがおおいので、Implementation … の登場で SBPP がさも役割を終えたかのような誤解をすることなく、Implementation … とあわせて SBPP も手に入れていただければな、と思いました。