Smalltalk Best Practice Patterns Volume 1: Coding Kent Beck First Class Software, Inc

Smalltalk Best Practice Patterns Volume 1: Coding Kent Beck First Class Software, Inc

Smalltalk Best Practice Patterns Volume 1: Coding Kent Beck First Class Software, Inc. Draft for comment only. Copyright (c) 1995, 1996, Kent Beck, All rights reserved. Please send comments to: voice: +1.408.338.4649 fax: +1.408.338.1115 email: [email protected] Coding Patterns page 1 of 147 9/30/2006 Table of Contents TABLE OF CONTENTS .......................................................................................................................................2 PREFACE ......................................................................................................................................................5 ACKNOWLEDGMENTS.............................................................................................................................7 INTRODUCTION .........................................................................................................................................8 CODING ............................................................................................................................................................9 Talking Programs........................................................................................................................................9 GOOD SOFTWARE...........................................................................................................................................11 STYLE.............................................................................................................................................................13 WHAT’S MISSING? .........................................................................................................................................14 ORGANIZATION ..............................................................................................................................................15 ADOPTION ......................................................................................................................................................16 PATTERNS..................................................................................................................................................17 WHY PATTERNS WORK..................................................................................................................................18 ROLE OF PATTERNS ........................................................................................................................................20 Reading......................................................................................................................................................20 Development..............................................................................................................................................20 Review .......................................................................................................................................................20 Documentation ..........................................................................................................................................20 Clean Up ...................................................................................................................................................20 FORMAT .........................................................................................................................................................21 BEHAVIOR .................................................................................................................................................22 METHODS.......................................................................................................................................................23 Composed Method ................................................................................................................................................. 24 Complete Creation Method .................................................................................................................................... 26 Creation Parameter Method ................................................................................................................................... 27 Conversion ............................................................................................................................................................. 28 Converter Method .................................................................................................................................................. 29 Converter Creation Method.................................................................................................................................... 30 Constructor Method ............................................................................................................................................... 31 Query Method ........................................................................................................................................................ 32 Comparing Method ................................................................................................................................................ 33 Execute Around Method ........................................................................................................................................ 34 Debug Printing Method.......................................................................................................................................... 35 MESSAGES......................................................................................................................................................36 Message.................................................................................................................................................................. 37 Choosing Message ................................................................................................................................................. 38 Decomposing Message........................................................................................................................................... 40 Intention Revealing Message ................................................................................................................................. 41 Intention Revealing Selector .................................................................................................................................. 42 Double Dispatch..................................................................................................................................................... 43 Send Back .............................................................................................................................................................. 45 Super ...................................................................................................................................................................... 47 Extending Super..................................................................................................................................................... 48 Modifying Super .................................................................................................................................................... 49 Delegation .............................................................................................................................................................. 50 Simple Delegation.................................................................................................................................................. 51 Self Delegation....................................................................................................................................................... 52 Pluggable Behavior ................................................................................................................................................ 54 Pluggable Selector.................................................................................................................................................. 55 Pluggable Block ..................................................................................................................................................... 56 Collecting Parameter.............................................................................................................................................. 57 Coding Patterns page 2 of 147 9/30/2006 STATE..........................................................................................................................................................59 INSTANCE VARIABLES....................................................................................................................................60 Common State........................................................................................................................................................ 61 Variable State......................................................................................................................................................... 62 Explicit Initialization.............................................................................................................................................. 63 Lazy Initialization .................................................................................................................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    147 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us