The objective-C runtime programming guide proxy object

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

The proxy object

Forwarding not only simulation of multiple inheritance, but also makes the object development representative or "cover" more objects lightweight as possible. Agent instead of other objects and informs it.

The discussion in the Objective-C programming language "remote message" proxy is a proxy that. The concern for forwarding messages to a remote receiver of the details of management, to ensure that the parameters of the value the connection has been copied and retrieval etc.. But it does not try to do the other; it does not copy the remote object function simply to remote objects in a local address, one can receive messages in other applications.

Proxy objects of other types is possible. Assume, for example, you have a lot of data operation object -- it may create a complex image or disk reads the last file contents. Set the object may be time consuming, so you like delay do -- it is needed or when the system resource is temporarily idle time. At the same time, you need at least a placeholder to this object to other objects in the application of normal operation.

In this case, you can start creating, not mature object, but a lightweight object to it. This object can do something themselves, such as answer the question about the data, but most situations, it just gives the object more occupied a position, when the time comes, forwarding the message to its. When the forwardInvocation: method of the proxy first receives the specified time to other objects, messages, it will determine the object exists and if there is no will create. For all the news of the larger object is by proxy, therefore, for the rest of the program, the agent and the object are the same.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Monica at December 15, 2013 - 11:15 AM