Java Design Patterns: Proxy Live Coding

preview_player
Показать описание
Java Design Patterns: Proxy Live Coding.

The Proxy pattern is a structural design pattern that provides an object that acts as
a substitute or placeholder for another object to control access to it.

This surrogate object is known as a "proxy," and it can perform tasks such as lazy initialization,
logging, controlling the operations, or managing access rights before delegating the call to the target object.

Consider a BankAccount class that provides basic operations such as deposit() and withdraw().
The BankAccountProxy class acts as a surrogate for the BankAccount class and performs tasks such as
checking the user's credentials and delegating the operation to the BankAccount object.
Рекомендации по теме