Understanding Proxy Pattern in C#
<p>Suppose if I am trying to access a method of a class through some other class like this  </p>

<pre><code>class SuperClass
    {
        public interface ISubject
        {
            void Print();
        }
        private class Subject : ISubject
        {
            public void Print()
            {
                Console.WriteLine("this is a print");
            }
        }
       public class Proxy {
            ISubject subject;
            public void CallOtherMethod() {
                subject = new Subject();
                subject.Print();
            }
        }
    }
    class Client: SuperClass
    {
        static void Main() {
            Proxy proxy = new Proxy();
            proxy.CallOtherMethod();
        }
    } 
</code></pre>

<p>is this called as a proxy Class? or does it Require to have a interface as an reference then we have to call the method? for instance like this </p>

<pre><code>class SuperClass
    {
        public interface ISubject
        {
            void Print();
        }
        private class Subject : ISubject
        {
            public void Print()
            {
                Console.WriteLine("this is a print");
            }
        }
        public class Proxy : ISubject
        {
            ISubject subject;
            public void Print()
            {
                subject = new Subject();
                subject.Print();
            }
        }
    }
    class Client : SuperClass
    {
        static void Main()
        {
            ISubject proxy = new Proxy();
            proxy.Print();
        }
    }
</code></pre>