20. Invocations

Invocations are a technique for preserving the state of messages, arguments, and return values. Invocations can be used to completely decouple the sender of a message from the receiver. The sender and receiver can be in different processes or separated by time. Invocations are implemented by Cocoa’s NSInvocation class and are used in distributed objects, undo and redo support, and scheduled periodic event processing. Invocations can be used in applications to provide a wide range of flexible and dynamic behavior. Invocations are a generalized implementation of the well-known Command pattern described at http://en.wikipedia.org/wiki/Command_pattern.

Motivation

Provide a means of capturing messages so that they can be stored, ...

Get Cocoa Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.