Summary

Amazon Goodreads This book has 77 patterns in it.

Introduction

position ease box interval due
front 2.50 0 0.00 2021-10-19T16:05:01Z

Values -> Principles -> Patterns —————————————> Abstraction level

Values

Consistent with excellence in programming.

  1. Communication
  2. Simplicity
  3. Flexibility

Principles

More specific than values to programming. Patterns can be discussed in principles.

  1. Local Consequences
  2. Minimize Repetitons(DRY)
  3. Logic and Data Together Another corollary of local consequence principle
  4. Symmetry mixing levels of abstractions voilates this symmetry
  5. Declarative Expression
  6. Rate of Change Temporal symmetry

Motivation

position ease box interval due
front 2.5 0 0 2021-08-08T17:07:47Z

Cost(total) = Cost(develop) + Cost(maintain) Cost(maintain) = Cost(understand) + Cost(change) + Cost(test) + Cost(deploy)

Refer to a pattern before writing code

Reconcile every bit of code you write to a pattern for a better understanding of patterns and your own styel.

Class

Has largest span of any implementation pattern.

Patterns

Class

This data goes together and this logic goes with it.

  • Data changes more frequently than logic: this makes classes work.
  • Inheritance is compression techinque, like any compression makes it difficult to read.
  • Metaphors for creating subclasses are important than overriding methods.

Simple Superclass Name

  • Right name is important
  • Especially naming classes rightly is more important
  • Using metaphor eases the process they bring rich context to imagine
  • Sometimes push harder to find the right name
    1. use thesaurus
    2. list best candidates then sleep over it or take a walk
    3. take a break, may be your subconicious will provide a better name

Qualified Subclass Name

They should communicate what they are like and how different they different from base class.

  1. Prepend one ore more modifiers(qualifiers) to the super class name
  2. Think from readers perspective rather than blidnly prepending for multiple hierarchies.