예제 #1
0
        static void Main(string[] args)
        {
            ICommandFactory factory = new StandardCommandFactory();

            ICommand cmd = factory.CreateChangeUserPasswordCmd(2, "stare hasło", "nowe hasło");

            cmd.Execute();

            Console.WriteLine();

            factory = new AdvancedCommandFactory();
            cmd     = factory.CreateChangeUserPasswordCmd(2, "stare hasło", "nowe hasło");

            cmd.Execute();
        }
예제 #2
0
        static void Main(string[] args)
        {
            ICommand cmd = new ChangeUserPassowrdCmd(2, "qwerty123", "QWERTY1234");

            ICommandFactory factory = new StandardCommandFactory();


            cmd = factory.CreateCommand(cmd);
            cmd.Execute();

            Console.WriteLine();

            factory = new AdvancedCommandFactory();
            cmd     = factory.CreateCommand(cmd);

            cmd.Execute();
        }