filmov
tv
Using Proxy pattern in Java project

Показать описание
Proxy is a structural design pattern that allows you to perform something either before or after the request gets through to the original object.
- Assume that we manage a store, when processing an order
if birthday of a user is greater than 2000 and he/she orders Beer products
then we don't process it.
- Implementation steps
1. Create Product class
2. Create User class
3. Create IOrderProcessing interface
4. Create OrderProcessing class that implements IOrderProcessing interface
5. Create OrderProxyProcessing class that IOrderProcessing interface
- Assume that we manage a store, when processing an order
if birthday of a user is greater than 2000 and he/she orders Beer products
then we don't process it.
- Implementation steps
1. Create Product class
2. Create User class
3. Create IOrderProcessing interface
4. Create OrderProcessing class that implements IOrderProcessing interface
5. Create OrderProxyProcessing class that IOrderProcessing interface