public void Execute() { IDialog dialog = factory.CreateDialog(); IClientView clientView = factory.CreateClientView(); ILoanView loanView = factory.CreateLoanView(); Client client = GetClient(dialog); Loan loan = GetLoan(dialog); client.Notify(loan.GetValues()); loan.AddObserver(client); }
public void Execute() { var arguments = new[] { "Id", "Amount", "Term", "Interest rate" }; IDialog dialog = uiFactory.CreateDialog(); var input = dialog.ShowDialog(arguments).ToArray(); string id = input[0]; decimal amount = Decimal.Parse(input[1]); int term = Int32.Parse(input[2]); double interestRate = Double.Parse(input[3]); Loan loan = factory.createLoan(id, amount, term, interestRate); loan.AddObserver(uiFactory.CreateLoanView()); repository.Add(loan); }