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.
- Communication
- Simplicity
- Flexibility
Principles
More specific than values to programming. Patterns can be discussed in principles.
- Local Consequences
- Minimize Repetitons(DRY)
- Logic and Data Together Another corollary of local consequence principle
- Symmetry mixing levels of abstractions voilates this symmetry
- Declarative Expression
- 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
- use thesaurus
- list best candidates then sleep over it or take a walk
- 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.
- Prepend one ore more modifiers(qualifiers) to the super class name
- Think from readers perspective rather than blidnly prepending for multiple hierarchies.