27
The PROXY Design Pattern Oleksandra Sopova Feb, 2014

The PROXY Design Pattern Oleksandra Sopova Feb, 2014

Embed Size (px)

Citation preview

Page 1: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

The PROXY Design Pattern

Oleksandra SopovaFeb, 2014

Page 2: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 3: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 4: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

Remote method invocation

Page 5: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 6: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 7: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 8: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

Back to our GumballMachine remote proxy

Page 9: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 10: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 11: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 12: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 13: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 14: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 15: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 16: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 17: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 18: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 19: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 20: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

In our dating service we want :- make sure that a customer can set his own information while preventing others from altering it-allow just the opposite with the HotOrNot ratings: we want the other customers to be able to set the rating, but not that particular customer

Page 21: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

Big Picture: creating a dynamic Proxy for the PersonBeanStep one: creating Invocation Handlers

Page 22: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 23: The PROXY Design Pattern Oleksandra Sopova Feb, 2014
Page 24: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

The Proxy Zoo

Page 25: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

SummaryThe Proxy pattern introduces a level of indirection when accessing an object.

•A remote proxy can hide the fact that an object resides in a different address Space.

•A virtual proxy can perform optimizations such as creating an object on Demand.

•Both protection proxies and smart references allow additional housekeeping tasks when an object is accessed.

Page 26: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

References

•Head First Design Patterns by Eric Freeman, Elisabeth Robson, Bert Bates, Kathy Sierra • Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma , Richard Helm, Ralph Johnson, John Vlissides• Design Patterns by Andriy Buday • RMI (Remote Method Invocation)http://habrahabr.ru/post/74639/

Page 27: The PROXY Design Pattern Oleksandra Sopova Feb, 2014

THANK YOU FOR YOUR ATTENTION