🎨 Design Patterns (Gang of Four)
Beginner
What is the Proxy design pattern?
Answer
The Proxy pattern provides a surrogate or placeholder for another object to control access to it. The proxy implements the same interface as the real object, so clients cannot tell the difference. Common types include: Virtual Proxy (lazy initialization — creates the expensive object only when first needed), Protection Proxy (access control — checks permissions before forwarding), and Remote Proxy (communicates with an object in a different address space over a network). Java's RMI stubs and Spring's @Transactional AOP proxies are well-known examples.
Previous
What is the Flyweight design pattern?
Next
What is the Chain of Responsibility design pattern?