What are the different types of Proxy?

Answer

The GoF Proxy pattern has several common variants. A Virtual Proxy delays the creation of an expensive object until it is actually needed (lazy initialization) — a high-resolution image thumbnail is a virtual proxy for the full image. A Protection Proxy controls access to the real object, checking permissions before forwarding calls — useful for role-based access control. A Remote Proxy provides a local representative for an object in a different address space or machine — RMI stubs in Java are remote proxies. A Caching Proxy stores results of expensive operations and returns cached results for repeated requests. A Logging Proxy records method calls and arguments for auditing.