public Facade()
 {
     _one   = new Subsystem1();
     _two   = new Subsystem2();
     _three = new SubSystem3();
     _four  = new SubSystem4();
 }
        static void Main(string[] args)
        {
            Subsystem1 subsystem1 = new Subsystem1();
            Subsystem2 subsystem2 = new Subsystem2();
            Facade     facade     = new Facade(subsystem1, subsystem2);

            Client.ClientCode(facade);
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Subsystem1 sub1 = new Subsystem1();
            Subsystem2 sub2 = new Subsystem2();

            Facade facade = new Facade(sub1, sub2);

            Console.WriteLine(facade.Operation());
            Console.ReadLine();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            Subsystem1 subsystem1 = new Subsystem1();
            Subsystem2 subsystem2 = new Subsystem2();
            Facade     facade     = new Facade(subsystem1, subsystem2);

            //Lam theo cach thongg thuong se goi thẳng vào luôn k qua facade :D
            //Console.WriteLine(subsystem1.operation1());
            Client.ClientCode(facade);
        }
Exemple #5
0
        static void Main(string[] args)
        {
            // The client code may have some of the subsystem's objects already
            // created. In this case, it might be worthwhile to initialize the
            // Facade with these objects instead of letting the Facade create
            // new instances.
            Subsystem1 subsystem1 = new Subsystem1();
            Subsystem2 subsystem2 = new Subsystem2();
            Facade     facade     = new Facade(subsystem1, subsystem2);

            Client.ClientCode(facade);
        }
Exemple #6
0
        static void Main(string[] args)
        {
            // В клиентском коде могут быть уже созданы некоторые объекты
            // подсистемы. В этом случае может оказаться целесообразным
            // инициализировать Фасад с этими объектами вместо того, чтобы
            // позволить Фасаду создавать новые экземпляры.
            Subsystem1 subsystem1 = new Subsystem1();
            Subsystem2 subsystem2 = new Subsystem2();
            Facade     facade     = new Facade(subsystem1, subsystem2);

            Client.ClientCode(facade);
        }
        static void Main(string[] args)
        {
            // type1
            var subsystem1 = new Subsystem1();
            var subsystem2 = new Subsystem2();
            var subsystem3 = new Subsystem3();
            var subsystem4 = new Subsystem4();

            Facade.Type1.Facade facadeType1 = new Facade.Type1.Facade(subsystem1, subsystem2, subsystem3, subsystem4);
            facadeType1.FacadeOperation1();
            facadeType1.FacadeOperation2();

            // type2
            Facade.Type2.Facade facadeType2 = new Facade.Type2.Facade();
            facadeType2.FacadeOperation1();
            facadeType2.FacadeOperation2();
        }
Exemple #8
0
 public Facade(Subsystem1 subsystem1, Subsystem2 subsystem2)
 {
     this._subsystem1 = subsystem1;
     this._subsystem2 = subsystem2;
 }
Exemple #9
0
 public Facade(Subsystem1 subsystem1, Subsystem2 subsystem2)
 {
     _subsystem1 = subsystem1;
     _subsystem2 = subsystem2;
 }