Пример #1
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Facade
            Mortgage mortgage = new Mortgage();

            // Evaluate mortgage eligibility for customer
            Customer customer = new Customer("Ann McKinsey");
            bool     eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name +
                              " has been " + (eligible ? "Approved" : "Rejected"));

            // Wait for user
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Mortgage mortgage = new Mortgage();

            // Evalua mortgage elegibilidad de usuario

            Customer customer = new Customer("Ann McKinsey");
            bool     eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name +
                              " has been " + (eligible ? "Approved" : "Rejected"));

            // Espera al usuario

            Console.ReadKey();
        }
Пример #3
0
        static void Main()
        {
            // Facade
            Mortgage mortgage = new Mortgage();

            // Evaluate mortgage eligibility for customer
            Customer customer = new Customer("Ann McKinsey");

            bool eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name +
                " has been " + (eligible ? "Approved" : "Rejected"));

            // Wait for user
            Console.ReadKey();
        }
Пример #4
0
        /// <resumen>

        /// Punto de entrada en la aplicación de consola.

        /// </resumen>

        static void Main(string[] args)
        {
            // Fachada

            Mortgage mortgage = new Mortgage();

            // Evaluar la elegibilidad de la hipoteca para el cliente

            Customer customer = new Customer("Ann McKinsey");
            bool     eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name +
                              " ha sido " + (eligible ? "Aprobado" : "Rechazado"));

            // Espera al usuario

            Console.ReadKey();
        }
Пример #5
0
        static void Main(string[] args)
        {
            //Separate the construction of a complex object from its representation so that the same
            //construction process can create different representations.
            Mortgage mortgage = new Mortgage();

            // Evaluate mortgage eligibility for customer

            Customer customer = new Customer("Ann McKinsey");
            bool     eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name +
                              " has been " + (eligible ? "Approved" : "Rejected"));

            // Wait for user

            Console.ReadKey();
        }
Пример #6
0
        public static void Run()
        {
            Console.WriteLine("\nThis real-world code demonstrates the Facade pattern as a MortgageApplication object which provides a simplified interface to a large subsystem of classes measuring the creditworthyness of an applicant.");
            Mortgage mortgage = new Mortgage();

            Customer customer = new Customer("Ann McKinsey");
            bool     eligible = mortgage.IsEligible(customer, 125000);

            Console.WriteLine("\n" + customer.Name + " has been " + (eligible ? "Approved" : "Rejected"));

            /*
             *  Ann McKinsey applies for $125,000.00 loan
             *
             *  Check bank for Ann McKinsey
             *  Check loans for Ann McKinsey
             *  Check credit for Ann McKinsey
             *
             *  Ann McKinsey has been Approved
             */
        }