Compare Proxy and Decorator in Java so access control and optional behavior layering are not treated as the same design move.
Proxy and Decorator both wrap an object and expose the same interface. The difference is why the wrapper exists.
Proxy exists to control access to the real object:
Decorator exists to add behavior around a component:
Ask:
ProxyDecoratorSome wrappers resemble both. When that happens, decide which concern is primary and name the abstraction accordingly.