예제 #1
0
        private static void Main()
        {
            var transfer = new TransferMoneyTask();
            var report   = new GenerateReportTask();

            transfer.Execute();
            report.Execute();
        }
        public static void Run()
        {
            var tranMoney = new TransferMoneyTask(new AuditTrail());
            var depoMoney = new DepositMoneyTask(new AuditTrail());

            tranMoney.Execute();
            depoMoney.Execute();
        }
예제 #3
0
        /// <summary>
        /// By using an abstract base class code duplication can be removed if multiple classes would do the same methods.
        /// </summary>
        static void Template()
        {
            var transferMoneyTask = new TransferMoneyTask();

            transferMoneyTask.Execute();

            var generateReportTask = new GenerateReportTask();

            generateReportTask.Execute();
        }
예제 #4
0
        private static void ExecuteTemplate()
        {
            var generateReport = new GenerateReportTask();

            generateReport.Execute();

            var transferMoney = new TransferMoneyTask();

            transferMoney.Execute();
        }
예제 #5
0
        static void TestTemplateMethod()
        {
            // This will first execute Audit Trail and then call the Transfer Money operations
            var transferMoney = new TransferMoneyTask();

            transferMoney.Execute();

            // This will first execute Audit Trail and then call the Generate Report operations
            var generateReport = new GenerateReportTask();

            generateReport.Execute();
        }
예제 #6
0
        public static void Behavioral_TemplateMethod()
        {
            // Transfer Money
            // Generate Report
            var task = new TransferMoneyTask();

            task.Execute();

            var report = new GenerateReportTask();

            report.Execute();
        }