public Client(AbstractFactory factory) { _abstractProductB = factory.CreateProductB(); _abstractProductA = factory.CreateProductA(); }
public override void Interact(AbstractProductA a) { Console.WriteLine(this.GetType().Name + " interact with " + a.GetType().Name); }
public abstract void Interact(AbstractProductA a);
// Methods override public void Interact(AbstractProductA a) { Console.WriteLine(this + " interacts with " + a); }
// Constructors public Environment(AbstractFactory factory) { AbstractProductB = factory.CreateProductB(); //child B AbstractProductA = factory.CreateProductA(); // child A }
public override string Interagir(AbstractProductA a) { return String.Format(this.GetType().Name + " interage com " + a.GetType().Name); }
public abstract string Interagir(AbstractProductA a);
//Construtor public Cliente(AbstractFactory abstractFactory) { _abstractProductA = abstractFactory.CriarProdutoA(); _abstractProductB = abstractFactory.CriarProdutoB(); }
/// <summary> /// The constructor initialises the properties using methods defined on the factory /// class that is passed as a parameter to the constructor. /// </summary> /// <param name="factory">Controls the type of objects that will be created. This will be /// a concrete implementation of an abstract base class.</param> public BasicClient(AbstractFactory factory) { _productA = factory.CreateProductA(); _productB = factory.CreateProductB(); }
public override void Interact(AbstractProductA a) { Console.WriteLine("Produto B2 " + " interage com Produto A2"); }
public override void Interact(AbstractProductA a) { Console.WriteLine(this.GetType().Name + " interacts with " + a.GetType().Name); }
// Constructor public Client(AbstractFactory factory) { abstractProductB = factory.CreateProductB(); abstractProductA = factory.CreateProductA(); }
public override void Interact(AbstractProductA a) { Log.WriteLine(GetType().Name + " interacts with " + a.GetType().Name); }
internal override string Interact(AbstractProductA a) { return(this.GetType().Name + " interacts with " + a.GetType().Name); }
private AbstractProductB _productB; //Class ==> Abstract Product B where abstract class should present public Client(AbstractFactory factory) //factory==>parameter { _productA = factory.CreateProductA(); //Object created for the class Abstract ProductA //Intantiated with class AbstractProductA _productB = factory.CreateProductB(); //Intantiated with class AbstractProductB //By using Parameter we have instantiated class where CreateProductA();and CreateProductB(); are the methods }