13.07.2015 Views

Smalltalk Best Practice Patterns Volume 1: Coding - Free

Smalltalk Best Practice Patterns Volume 1: Coding - Free

Smalltalk Best Practice Patterns Volume 1: Coding - Free

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

STATE..........................................................................................................................................................59INSTANCE VARIABLES....................................................................................................................................60Common State........................................................................................................................................................ 61Variable State......................................................................................................................................................... 62Explicit Initialization.............................................................................................................................................. 63Lazy Initialization .................................................................................................................................................. 65Default Value Method............................................................................................................................................ 66Constant Method.................................................................................................................................................... 67Direct Variable Access........................................................................................................................................... 68Indirect Variable Access ........................................................................................................................................ 69Getting Method ...................................................................................................................................................... 70Setting Method....................................................................................................................................................... 71Collection Accessor Method .................................................................................................................................. 72Enumeration Method.............................................................................................................................................. 74Boolean Property Setting Method .......................................................................................................................... 75Role Suggesting Instance Variable Name .............................................................................................................. 76TEMPORARY VARIABLES................................................................................................................................77Temporary Variable ............................................................................................................................................... 78Collecting Temporary Variable.............................................................................................................................. 79Caching Temporary Variable ................................................................................................................................. 80Explaining Temporary Variable ............................................................................................................................. 81Reusing Temporary Variable ................................................................................................................................. 82Role Suggesting Temporary Variable Name.......................................................................................................... 83COLLECTIONS..........................................................................................................................................84CLASSES.........................................................................................................................................................85Collection............................................................................................................................................................... 86OrderedCollection .................................................................................................................................................. 87RunArray................................................................................................................................................................ 88Set .......................................................................................................................................................................... 89Equality Method..................................................................................................................................................... 91Hashing Method..................................................................................................................................................... 93Dictionary............................................................................................................................................................... 94SortedCollection..................................................................................................................................................... 96Array ...................................................................................................................................................................... 97ByteArray............................................................................................................................................................... 98Interval ................................................................................................................................................................... 99COLLECTION PROTOCOL...............................................................................................................................101IsEmpty ................................................................................................................................................................ 102Includes:............................................................................................................................................................... 103Concatentation ..................................................................................................................................................... 104Enumeration ......................................................................................................................................................... 105Do......................................................................................................................................................................... 106Collect.................................................................................................................................................................. 107Select/Reject......................................................................................................................................................... 108Detect ................................................................................................................................................................... 109Inject:into:............................................................................................................................................................ 110COLLECTION IDIOMS ....................................................................................................................................111Duplicate Removing Set....................................................................................................................................... 112Temporarily Sorted Collection............................................................................................................................. 113Stack..................................................................................................................................................................... 114Queue ................................................................................................................................................................... 115Searching Literal .................................................................................................................................................. 117Lookup Cache ...................................................................................................................................................... 118Parsing Stream ..................................................................................................................................................... 120Concatenating Stream .......................................................................................................................................... 121CLASSES ...................................................................................................................................................122Simple Superclass Name ...................................................................................................................................... 123<strong>Coding</strong> <strong>Patterns</strong> page 3 of 147 9/30/2006

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!