100 likes | 298 Views
Connections. Karl Lieberherr. Sources of Information. Textbook: The Pragmatic Programmer (TPP) My book: AP book + lecture notes Java Data Binding Technology Tools we use: DJ, later we use DemeterJ. TPP section: The Evils of Duplication. Tip 11: DRY – Don’t Repeat Yourself
E N D
Connections Karl Lieberherr
Sources of Information • Textbook: The Pragmatic Programmer (TPP) • My book: AP book + lecture notes • Java Data Binding Technology • Tools we use: DJ, later we use DemeterJ
TPP section: The Evils of Duplication • Tip 11: DRY – Don’t Repeat Yourself • Imposed duplication without tool support
Connections • TPP Tip 11: DRY • Don’t duplicate class graph information in programs and in inputs • Programs: traversal strategies • Inputs: parsing • TPP Tip 17: • Program close to problem domain • Use class dictionary describing application objects
Connections • TPP Tip 36: LoD • Minimize coupling between modules: avoid coupling by writing “shy” code • traversal strategies • TPP Tip 20: Keep knowledge in plain text • Java data binding: class dictionary and sentences
TPP section: Decoupling and the Law of Demeter • Write shy code: • A shy person does not interact with too many people. • A shy method does not interact with too many classes/objects.
Connections • TPP Tip 37:"Configure, Don't Integrate“ • We configure programs with class graphs, traversal graphs or object graph slices and we don’t integrate those structures into the program manually.
Connections • TPP Tip 38: "Put Abstractions in Code, Details in Metadata“ • We put abstractions like ClassGraph.traverse(Object, Strategy, Visitor) into code and details like whereToGo into metadata.
TPP: Tip 53: Abstractions Live Longer than Details • Is in the Requirements Pit section • Also applies to code: don’t overspecify!
TPP: Tip 54: Don’t Program by Coincidence • Don’t confuse a happy coicidence with a purposeful plan.