Skip to content

Instantly share code, notes, and snippets.

@novi
Created February 15, 2011 17:54
Show Gist options
  • Save novi/827909 to your computer and use it in GitHub Desktop.
Save novi/827909 to your computer and use it in GitHub Desktop.
Cocoaのデザインパターンまとめ
  • Singleton
  • Abstract Factory - |NSWindow| (Theme, Style)
  • Builder - WebKit Document Representation
  • Prototype - |NSCollectionViewItem|, Cell
  • FactoryMethod - |NSDocument|, ClassCluster
  • Adapter - Delegate, CocoaBinding
  • Bridge - |NSImageRep|, Wrapper
  • Composite - View Hierarchy, Tree
  • Decorator - |NSBox|, |NSScrollView|
  • Facade - |NSTextView|
  • Flyweight - |NSNumber|
  • Proxy - |NSProxy|
  • Iterator - Object Enumerator
  • Command - Target and Action
  • Chain of Responsibility - First Responder
  • Memento - |NSUndoManager|
  • Observer - NotificationCenter,
  • Mediator - Controller
  • Interpreter - Grapher.app implementation
  • State
  • Strategy - |NSURLProtocol|
  • Template Method - |-drawRect|, |-layoutSubviews|, Abstract Class (Method)
  • Visitor

c.f. Dynamic Objective-C (Makoto Kinoshita) http://hmdt.jp/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment