Example #1
0
        static void Main(string[] args)
        {
            //abstract factory design pattern
            TestAbstractFactory tbf = new TestAbstractFactory();

            tbf.Run();

            //factory method design pattern
            TestFactoryMethod tfm = new TestFactoryMethod();

            tfm.Run();

            //Singleton design pattern
            TestSingleton ts = new TestSingleton();

            ts.Run();

            TestOptimizedSingleton tos = new TestOptimizedSingleton();

            tos.Run();

            //Bridge design pattern
            TestBridge tb = new TestBridge();

            tb.Run();
        }
        static void Main(string[] args)
        {
            TestBridge cls1 = new TestBridge();

            cls1.Execute();

            TestFactory cls5 = new TestFactory();

            cls5.Execute();

            TestBuilder cls15 = new TestBuilder();

            cls15.Execute();

            TestPrototype cls9 = new TestPrototype();

            cls9.Execute();

            TestObserver cls7 = new TestObserver();

            cls7.Execute();

            TestAdaptor cls = new TestAdaptor();

            cls.Execute();

            TestDecorater cls4 = new TestDecorater();

            cls4.Execute();

            TestComposite cls3 = new TestComposite();

            cls3.Execute();

            TestProxy cls10 = new TestProxy();

            cls10.Execute();

            TestIterator cls6 = new TestIterator();

            cls6.Execute();

            TestState cls14 = new TestState();

            cls14.Execute();

            TestCommand cls2 = new TestCommand();

            cls2.Execute();

            // ************
            TestProducerConsumer cls8 = new TestProducerConsumer();

            cls8.Execute();

            TestReaderWriter cls11 = new TestReaderWriter();

            cls11.Execute();

            TestSimpleThread cls12 = new TestSimpleThread();

            cls12.Execute();

            TestSingleton cls13 = new TestSingleton();

            cls13.Execute();
        }