Ejemplo n.º 1
0
 public ProductEntity GetProductRequest()
 {
     // A virtual proxy creates the object only on its first method call i.e On demand
     if (realSubject == null)
     {
         realSubject = new ProductRealSubject();
     }
     return(realSubject.GetProductRequest());
 }
Ejemplo n.º 2
0
 public string Authenticate(string _password)
 {
     if (_password != password)
     {
         validationMessage = "Authentication Failed";
     }
     else
     {
         realSubject       = new ProductRealSubject();
         validationMessage = "Authenticated, Kindly Continue Shopping";
     }
     return(validationMessage);
 }