Roadmap › Design Patterns (GoF + Enterprise) in C# › Module: Behavioural Patterns
Lessons in this course (18)

14. Iterator, Visitor, Memento and Interpreter

AdvancedLowLesson 14 of 18
  • Iterator — sequential access without exposing internals: IEnumerable<T> + yield return.
  • Visitor — add operations to a class hierarchy without changing it (double dispatch); Roslyn syntax walkers and LINQ ExpressionVisitor use it.
  • Memento — capture and restore state (undo). Records + with make snapshots easy.
  • Interpreter — evaluate a small grammar (rule engines, expression trees).