CSE 201 Lecture Notes - Lecture 11: Software Design, Underlying Representation, Iterator
Document Summary
Cse 201 - lecture 11 - good design. Don"t reinvent the solution- as with any craft, programming contains undeniable element of experience. We achieve mastery through applying to actual problems/solutions. Programming idioms: often programming language-specific (i++ is same as i+=1 is the same as i=i+1) Design patterns are more abstract than programming idioms. Design patterns are description of problem and the essence of its solution is to enable the solution to be reused in different settings. Solutions are heavily influenced by practical experience. Gang of four design pattern book: 23 design patterns. Popular patterns: facade, adapter, observer, builder, singleton, iterator. Iterator: provide a way to access elements of an aggregate (collection) object sequentially without exposing its underlying representation. Aggregate object is collection of items: linkedlist foo; Java iterator is an interface that can be implemented by any aggregate and has the following methods: hasnext(), next(), remove() Lingo is helpful: many large projects and programming languages use terminology from design patterns.