Agent mode--headfirst design mode learning Notes

Source: Internet
Author: User

Proxy mode: Provides an alias or placeholder for another object to control access to this object

Characteristics:

    • Allow proxy objects to control access to objects, which can be remote objects (remote proxies), create expensive objects (virtual proxies), or objects that require security control (protection agents)

Agent classification:

    • Remote proxy: A local representation of a remote object (the object of a different JVM virtual machine) (the behavior of the local method is transferred to the remote) to help us deal with the details on the network
      • The agent pretends to be a remote object, but it's just an intermediate role that handles accessing remote objects
      • Java RMI provides the customer helper stub and the service helper object skeleton, and provides the same method for it

      • Note the method return value needs to be set to serializable object serializable, which does not require a serialized state variable to use transient declaration
      • Note Handling Remote access exceptions
      • Execution process: From the remote get proxy object-"Client calls proxy object Method-" Call Send to remote-"Remote accept call information and operation on the specific object-" Get results returned to the agent-"agent to tell the results to the customer

Agent mode--headfirst design mode learning Notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.