Ejemplo n.º 1
0
        public void ClientMethod(IFactoryCar factory)
        {
            IAbstractEngine engine = factory.CreateEngine();
            IAbstractBody   body   = factory.CreateBody();

            Console.WriteLine(body.BodyInfo());
            Console.WriteLine(body.AnotherUsefulFunctionB(engine));
        }
Ejemplo n.º 2
0
        public string AnotherUsefulFunctionB(IAbstractEngine collaborator)
        {
            var result = collaborator.EngineInfo();

            return($"The result of the BodyByToyota collaborating with the ({result})");
        }