In Proxy pattern, a class represents functionality of another class. This type of design pattern comes under structural pattern.
In Proxy pattern, we create object having original object to interface its functionality to outer world.
Implementation
We're going to create a Person interface and concrete classes implementing the Person interface.ProxyPerson is a a proxy class to reduce memory footprint of RealPerson object loading.
ProxyPatternDemo, our demo class will use ProxyPerson to get a Person object to load and display Name as it needs.