*Abstract Factory
Creates an instance of several families of classes *
Creates an instance of several families of classes *
NSObject Objective-C class methods are sometimes call factory methods. This pattern is intrinsic to the Objective-C language. Every Objective C class is potentially an abstract factory. This pattern is also used to implement CocoaClassClusters. SubClass">ShouldClassClusterPlaceholderBeASubClasshttp://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Builder Separates object construction from its representation *
NSDocumentManager? � Builds NSDocument instances with NSWindowManager(s), handles recent documents menu, builds document related responder chain� NSApplication? � Builds main menu, initial responder chain, run loop�
*Factory Method Creates an instance of several derived classes *
Objective-C class methods are sometimes call factory methods. This pattern is intrinsic to the Objective-C language. NSObject ClassClusters. SubClass">ShouldClassClusterPlaceholderBeASubClasshttp://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/index.html
*Prototype A fully initialized instance to be copied or cloned *
NSCell is a Prototype when used with NSMatrix.
*Singleton A class of which only a single instance can exist *
SingletonDesignPattern SingletonAlternatives NSApplication NSNull NSFileManager NSWorkspace http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaObjects/Articles/CreateSingleton.html http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaObjects/Articles/ObjectCreation.html
Structural Patterns
*Adapter Match interfaces of different classes *
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Bridge Separates an object�s interface from its implementation *
*Composite A tree structure of simple and composite objects *
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.htmlWrappingIsBad
*Decorator Add responsibilities to objects dynamically *
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Facade A single class that represents an entire subsystem *
NSImage - NSText and NSTextView encapsulate the functionality of complex text layout and editing which is internally implement with NSTextStorage, NSLayoutManager, and other classes.
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Flyweight A fine-grained instance used for efficient sharing * NSCell
*Proxy An object representing another object *
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
Behavioral Patterns
*Chain of Resp. A way of passing a request between a chain of objects *
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Command Encapsulate a command request as an object *
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Interpreter A way to include language elements in a program *
Value Transformers?
*Iterator Sequentially access the elements of a collection *
NSEnumerator http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Mediator Defines simplified communication between classes *
NSObjectController, NSArrayController, NSTreeController, and NSUserDefaultsController http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Memento Capture and restore an object's internal state *
NSCoder NSKeyedArchiver and NSKeyUnarchiver http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Observer A way of notifying change to a number of classes *
NSNotificationCenterhttp://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*State Alter an object's behavior when its state changes *
*Strategy Encapsulates an algorithm inside a class *
NSLayoutMananger NSFormatter?
*TemplateMethod Defer the exact steps of an algorithm to a subclass *
http://developer.apple.com/documentation/Cocoa/Conceptual/DesignPatterns">CocoaDesignPatterns/index.html
*Visitor Defines a new operation to a class without change *
Cocoa Unique Patterns
*Target/Action A variation/simplification of the Command pattern *
NSControl NSActionCell @selector Similar to Qt Signals & Slots
*Method Swizzling A technique for runtime modification of the relationship between message selectors and the implementation that will be called in response to a message *
*Delegation Enable one object to control, modify, or specialize the behavior of another object through a loosely coupled interface.
Niciun comentariu:
Trimiteți un comentariu