Пример #1
0
        public void Test()
        {
            Mortgage mortgage = new Mortgage();
            Customer cust     = new Customer("Mohsen");

            Console.WriteLine("The Customer Mohsen eligibility is " + mortgage.IsEligible(cust, 3000));
        }
Пример #2
0
        public void FacadeControl()
        {
            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"));
        }
Пример #3
0
        public static void FacadeDesignPattern()
        {
            string _approved = "approved";
            string _rejected = "rejected";

            // Facade
            Mortgage mortgage = new Mortgage();

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

            Console.WriteLine($"{ customer.Name} has been" + (eligible ? _approved : _rejected));


            // Wait for user
            Console.ReadKey();
        }