Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Client: Executing the client code with a real subject:");
            RealSubject realSubject = new RealSubject();

            Client.ClientCode(realSubject);

            Console.WriteLine();

            Console.WriteLine("Client: Executing the same client code with a proxy:");

            // usually: Lasy loading, cash, check access, logging...
            Proxy proxy = new Proxy(realSubject);

            Client.ClientCode(proxy);
        }
Exemplo n.º 2
0
 public Proxy(RealSubject realSubject)
 {
     this.realSubject = realSubject;
 }