Beispiel #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();
        }
Beispiel #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();
        }
Beispiel #4
0
        private static void ExecuteTemplate()
        {
            var generateReport = new GenerateReportTask();

            generateReport.Execute();

            var transferMoney = new TransferMoneyTask();

            transferMoney.Execute();
        }
Beispiel #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();
        }
Beispiel #6
0
        public static void Behavioral_TemplateMethod()
        {
            // Transfer Money
            // Generate Report
            var task = new TransferMoneyTask();

            task.Execute();

            var report = new GenerateReportTask();

            report.Execute();
        }