Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pattern Language for Rubyists (Rev.2)

Pattern Language for Rubyists (Rev.2)

What is the difference between experts and beginners? How can we describe our important knowledge? This presentation introduces the pattern language and its relation to software development, then shows an example activity.

Hiroki Yoshioka

June 11, 2015
Tweet

More Decks by Hiroki Yoshioka

Other Decks in Programming

Transcript

  1. A pattern language is a method of describing good design

    practices within a field of expertise. – Wikipedia, “Pattern language”
  2. Beyond its elements each building is defined by certain patterns

    of relationships among the the elements. –Christopher Alexander, “The Timeless Way of Building”
  3. And each law of pattern is itself a pattern of

    relationships among still other laws, which are themselves just patterns of relationships again. –Christopher Alexander, “The Timeless Way of Building”
  4. From a mathematical point of view, the simplest kind of

    language is a system which contains two sets: 1. A set of elements, or symbols. 2. A set of rules for combining these symbols. –Christopher Alexander, “The Timeless Way of Building”
  5. Natural Language Pattern Language Words Patterns Rules of grammar and

    meaning which give connections Patterns which specify connections between patterns Sentences Buildings and places –Christopher Alexander, “The Timeless Way of Building”
  6. Each pattern is a rule which describes what you have

    to do to generate the entity which it defines. –Christopher Alexander, “The Timeless Way of Building”
  7. The specific patterns out of which a building a town

    is made may be alive or dead. To the extent they are alive, they let our inner forces loose, and set us free; but when they are dead they keep us locked in inner conflict. –Christopher Alexander, “The Timeless Way of Building”
  8. 1. Independent Regions 2. Distribution of Towns 3. City Country

    Fingers 4. Agricultural Valleys 5. Lace of Country Streets 6. Country Towns 7. The Countryside Pattern #1~7
  9. 105. South Facing Outdoors 106. Positive Outdoor Space 107. Wings

    of Light 108. Connected Buildings 109. Long Thin House Pattern #105~109
  10. 197. Thick Walls 198. Closets Between Rooms 199. Sunny Counter

    200. Open Shelves 201. Waist-high Shelf 202. Built-in Seats Pattern #197~202
  11. You can use it to design a house for yourself,

    with your family; or to work with other people to design an office or a workshop or a public building like a school. –Christopher Alexander et al, “A Pattern Language”
  12. A Small Pattern Language for GUI 1. Window Per Task

    2. Few Panes Per Window 3. Standard Panes 4. Short Menus 5. Nouns and Verbs
  13. “We presented these patterns to a team of application specialists

    writing a specification for a special purpose programming environment. Without detailed understanding of any of Smalltalk's interface mechanisms (MVC for example) they were able to specify very reasonable interfaces after one day of practice.” –Kent Beck, Ward Cunningham, “Using Pattern Languages for Object-Oriented Programs”
  14. We have written this book as a first step in

    the society-wide process by which people will gradually become conscious of their own pattern languages, and work to improve them. –Christopher Alexander et al, “A Pattern Language”
  15. How we found Rails dev. patterns 1. Kick off meeting

    2. Discuss development knacks (pristine “patlets”) 3. Group patlets in KJ-method 4. Rewrite the groups in pattern form 5. Find sequence of patterns (WIP) 6. Refine the patterns (WIP)
  16. Rails Development Patterns 18 patlets / 6 patterns in form

    Reviewed at AsianPLoP 2015 Work in progress on GitHub (rails- patterns/rails_dev_patterns)
  17. “ެࣜ৘ใ”
 (Official Information) Context: You are going to use a

    new or unfamiliar feature of Rails. Problem: You may copy and paste misinformation from the web. Solution: Refer the official Rails guide or the API reference.
  18. “ެવͷSQL”
 (Not-so-Secret SQL) Context: You are going to use an

    ActiveRecord to make a database query. Problem: You may make ineffective, wasteful queries. Solution: Confirm what SQL the ActiveRecord generates.
  19. We have written this book as a first step in

    the society-wide process by which people will gradually become conscious of their own pattern languages, and work to improve them. –Christopher Alexander et al, “A Pattern Language”