public void ClientMethod(IAbstractFactory factory) { IAbstractProductMainboard productA = factory.CreateProductMainboard(); IAbstractProductProcessor productB = factory.CreateProductProcessor(); Console.WriteLine(productB.UsefulFunction()); Console.WriteLine(productB.AnotherUsefulFunction(productA)); }
public string AnotherUsefulFunction(IAbstractProductMainboard collaborator) { var result = collaborator.UsefulFunction(); return($"The result of the Sony Processor collaborating with the ({result})"); }