Facade Design Pattern

Ayeshajaved
Posted by Ayeshajaved under ASP.NET category on | Points: 40 | Views : 381
class Buy_Mobile_Phones
{
public void Mobile_Phones_Categories()
{
Console.WriteLine("Buy_Mobile_Phones - Mobile_Phones_Categories");
}
}
class Buy_Home_Appliances
{
public void Home_Appliances_Categories()
{
Console.WriteLine("Buy_Home_Appliances - Home_Appliances_Categories ");
}
}

class Buy_Animals
{
public void Animals_Categories()
{
Console.WriteLine("Buy_Animals - Animals_Category");
}
}

class Buy_Laptops
{
public void Laptops_Categories()
{
Console.WriteLine("Buy_Laptops - Laptops_Category ");
}
}

public class Online_Shopping_Website
{
Buy_Mobile_Phones buy_mob;
Buy_Home_Appliances buy_home_app;
Buy_Animals buy_animals;
Buy_Laptops buy_latops;

public Online_Shopping_Website()
{
buy_mob= new Buy_Mobile_Phones();
buy_home_app = new Buy_Home_Appliances();
buy_animals = new Buy_Animals();
buy_latops = new Buy_Laptops();
}

public void Display_Online_Shopping()
{
Console.WriteLine("******** Display Categories **********\n");
buy_mob.Mobile_Phones_Categories();
buy_home_app.Home_Appliances_Categories();
buy_animals.Animals_Categories();
buy_latops.Laptops_Categories();

Console.WriteLine("");
}
}

class Program
{
static void Main(string[] args)
{
Online_Shopping_Website online_shopping_website = new Online_Shopping_Website();

online_shopping_website.Display_Online_Shopping();

Console.ReadKey();

}
}

Comments or Responses

Login to post response