Esempio n. 1
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Create RefinedAbstraction
            Customers customers = new Customers("Chicago");

            // Set ConcreteImplementor
            customers.Data = new CustomersData();

            // Exercise the bridge
            customers.Show();
            customers.Next();
            customers.Show();
            customers.Next();
            customers.Show();

            customers.Add("Henry Velasquez");
            customers.Add("Mikhail Jacques");

            customers.Next();
            customers.Show();

            customers.Add("Tom Jerry");

            customers.ShowAll();

            // Wait for user
            Console.ReadKey();
        }
Esempio n. 2
0
        public static void Run()
        {
            Console.WriteLine("This real-world code demonstrates the Bridge pattern in which a BusinessObject abstraction is decoupled from the implementation in DataObject. The DataObject implementations can evolve dynamically without changing any clients.");

            Customers customers = new Customers("Chicago");

            customers.Data = new CustomersData();

            customers.Show();
            customers.Next();
            customers.Show();
            customers.Next();
            customers.Show();
            customers.Add("Henry Velasquez");

            customers.ShowAll();

            /*
             * Jim Jones
             * Samual Jackson
             * Allen Good
             *
             * ------------------------
             * Customer Group: Chicago
             * Jim Jones
             * Samual Jackson
             * Allen Good
             * Ann Stills
             * Lisa Giolani
             * Henry Velasquez
             * ------------------------
             */
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            // Create RefinedAbstraction

            Customers customers = new Customers("Chicago");

            // Set ConcreteImplementor

            customers.Data = new CustomersData();

            // Exercise the bridge

            customers.Show();
            customers.Next();
            customers.Show();
            customers.Next();
            customers.Show();
            customers.Add("Henry Velasquez");

            customers.ShowAll();

            // Wait for user

            Console.ReadKey();
        }
Esempio n. 4
0
        static void Main()
        {
            // Create RefinedAbstraction
            Customers customers = new Customers("Chicago");

            // Set ConcreteImplementor
            customers.Data = new CustomersData();

            // Exercise the bridge
            customers.Show();
            customers.Next();
            customers.Show();
            customers.Next();
            customers.Show();
            customers.Add("Henry Velasquez");
            customers.ShowAll();
        }
Esempio n. 5
0
        /// <summary>
        /// BRIDGE
        ///  Decouple an abstraction from its implementation so that the two can vary independently.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            //Customers customers = new Customers("Chicago");
            //customers.Data = new CustomersData();
            Customers customers = new Customers("Chicago")
            {
                Data = new CustomersData()
            };

            customers.Show();
            customers.Next();
            customers.Show();
            customers.Next();
            customers.Show();
            customers.Add("Henry Velasquez");

            customers.ShowAll();

            Console.ReadKey();
        }
Esempio n. 6
0
        //Desacoplar uma abstração de sua implementação
        //    para que as duas possam variar independentemente.
        static void Main(string[] args)
        {
            //Esse código do mundo real demonstra o padrão Bridge no qual
            //uma abstração do BusinessObject é dissociada da implementação no DataObject.
            //As implementações do DataObject podem evoluir dinamicamente sem alterar nenhum cliente.
            Customers customers = new Customers("Chicago");

            // Set ConcreteImplementor

            customers.Data = new CustomersData();

            // Exercise the bridge

            customers.Show();
            customers.Next();
            customers.Show();
            customers.Next();
            customers.Show();
            customers.Add("Henry Velasquez");

            customers.ShowAll();
        }
        static void Main(string[] args)
        {
            Customers customers = new Customers("Chicago");



            // Establecer Implementador de Concreto

            customers.Data = new CustomersData();



            // ejercitar el puente

            customers.Show();

            customers.Next();

            customers.Show();

            customers.Next();

            customers.Show();

            customers.Add("Henry Velasquez");



            customers.ShowAll();



            //Esperando el usuario

            Console.ReadKey();
        }