public void ClientMethod(IAbstractFactory factory) { IAbstractProductEngine productA = factory.CreateProductEngine(); IAbstractProductBody productB = factory.CreateProductBody(); Console.WriteLine(productB.UsefulFunctionBody()); Console.WriteLine(productB.AnotherUsefulFunctionBody(productA)); }
public string AnotherUsefulFunctionBody(IAbstractProductEngine collaborator) { var result = collaborator.UsefulFunctionEngine(); return($"The result of the Toyota Body collaborating with the ({result})"); }