From the course: C++ Design Patterns: Structural
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Overview - C++ Tutorial
From the course: C++ Design Patterns: Structural
Overview
- [Instructor] The Proxy Structural Design Pattern allows us to provide a surrogate or placeholder for another object to control access to it. The proxy acts as an intermediary between the client and the real object intercepting all requests and performing any necessary operations before or after forwarding the request to the actual object. Introducing an additional level of indirection can provide many benefits such as lazy loading, access control, and caching. The Proxy Design Pattern is often used in scenarios where you want to limit direct object exposure or enable additional functionality. There are three main types of proxies. Virtual, remote, and protective. Virtual proxies are used to delay the creation of large objects until they are actually needed, a process also known as lazy loading. They act as placeholders for objects that might be expensive to create, such as objects that require significant resources to…