what to know for the exam. smalltalk will be used for questions, but there will not be questions...
TRANSCRIPT
What to know for the exam
• Smalltalk will be used for questions, but there will not be questions about the grammar.
• Questions might ask – how particular patterns are different for Smalltalk– How to program a pattern in Smalltalk– How to program basic OO problem– questions that assume general knowledge of basic
classes like collections or streams
Kent Beck patterns
• Composed method• Complete creation method• Conversion method• Query method• Intention revealing message• Double dispatch
Core patterns
• Mediator• Façade• Proxy• Command• Template Method• Adapter• Null Object
• Composite• Strategy• Decorator• State• Iterator• Observer• Value Object
Creational
• Abstract factory (peripheral)• Factory method• Prototype• Builder• Singleton• Dependency Injection
Peripheral
• Memento• Chain of responsibility• Bridge• Visitor• Type Object• Extension Object• Generation Gap
Compound
• Flyweight– To save space, factor out a Value Object, and
create them using a Memoizing Factory that records the flyweight pool.
• Interpreter– Represent a program with a Composite, and let
the class hierarchy match the grammar of the language. Define an “interpret” method in each class.
Dangerous Patterns
• Mediator– Supposed to be used to allow colleagues to be
reusable. Is often used to allow programmers to continue to be procedural.
• Singleton– Supposed to be used to encapsulate global state
when it cannot be eliminated. Is often used as a justification of global state.
Principles
• Single responsibility principle• Open/closed principle• Liskov substitution principle• Dependency inversion principle