You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using AbstractFactory.Factories;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace AbstractFactory
|
|
|
|
|
{
|
|
|
|
|
internal class Client
|
|
|
|
|
{
|
|
|
|
|
public void Main()
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Client: Testring client code with the first factory type...");
|
|
|
|
|
ClientMethod(new ConcreteFactory1());
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("---");
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Client: Testring client code with the second factory type...");
|
|
|
|
|
ClientMethod(new ConcreteFactory2());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ClientMethod(IAbstractFactory factory)
|
|
|
|
|
{
|
|
|
|
|
var ProductA = factory.CreateProductA();
|
|
|
|
|
var ProductB = factory.CreateProductB();
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(ProductB.UsefulFuctionB());
|
|
|
|
|
Console.WriteLine(ProductB.AnotherUsefulFunctionB(ProductA));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|