56 return String.Format(
"Real class received '{0}'", someArgument);
86 Console.WriteLine(
" --> Creating instance of real class...");
111 Console.WriteLine(
" --> proxy class DoWork() in");
113 Console.WriteLine(
" --> Forwarding DoWork() call to real class...");
114 return realClass.
DoWork(someArgument);
133 Console.WriteLine(
" --> Creating instance of proxy class...");
The proxy class that implements the IWorkByProxy.
IWorkByProxy _GetRealClass()
Helper method to retrieve the one and only instance of the real class. This hides the details of inst...
IWorkByProxy? _realClassInstance
The one and only instance of the real class associated with this proxy class instance.
The real class object that does all the work.
For the purposes of this example, this class encapsulates the real class and proxy class to hide them...
static IWorkByProxy CreateProxy()
Retrieve a new instance of the proxy class.
Represents what can be done on the proxy object. This same interface is implemented on the real objec...
string DoWork(string someArgument)
Does some work on the given argument and returns a new string.
The namespace containing all Design Pattern Examples implemented in C#.