static void Main(string[] args) { ICreditManager ihtiyacCreditManager = new IhtiyacCreditManager(); ICreditManager houseCreditManager = new HouseCreditManager(); ICreditManager vehicleCreditManager = new VehicleCreditManager(); ICreditManager esnafCreditManager = new EsnafCreditManager(); ILoggerService fileLogger = new FileLoggerService(); ILoggerService databaseLogger = new DatabaseLoggerService(); ILoggerService smsLogger = new SmsLoggerService(); //ihtiyacCreditManager.Calculate(); //houseCreditManager.Calculate(); //vehicleCreditManager.Calculate(); BasvuruManager basvuruManager = new BasvuruManager(); basvuruManager.DoBasvuru(vehicleCreditManager, fileLogger); basvuruManager.DoBasvuru(houseCreditManager, databaseLogger); basvuruManager.DoBasvuru(ihtiyacCreditManager, smsLogger); basvuruManager.DoBasvuru(esnafCreditManager, fileLogger); Console.WriteLine("----------------------"); List <ICreditManager> credits = new List <ICreditManager>() { ihtiyacCreditManager, houseCreditManager }; basvuruManager.DoCreditPreview(credits); }
static void Main(string[] args) { ICreditManager ihtiyacCreditManager = new IhtiyacCreditManager(); //interfaceler implemente edildiiği sınıfların referans nolarını tutabilirler o yüzden ICreditManager yazsam da çalışır aynı şey TasitCreditManager tasitCreditManager = new TasitCreditManager(); //burada tasit yazdım anlasılsın diye ICredit de yazsam aynı şey olacak ICreditManager konutCreditManager = new KonutCreditManager(); ICreditManager esnafCreditManager = new EsnafCreditManager(); ILoggerService dataBaseLoggerService = new DataBaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); ILoggerService smsLoggerService = new SmsLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.Apply(konutCreditManager, new DataBaseLoggerService(), new List <ILoggerService> { new DataBaseLoggerService(), new SmsLoggerService() }); //buradaki logu ya da kredi türünü değiştirdiğim takdirde hangi seçeneği istiyorsam sağlarım.İster taşıt ister file logu ya da istediğim farklı kombinasyonlar applyManager.Apply(esnafCreditManager, new SmsLoggerService(), new List <ILoggerService> { new DataBaseLoggerService(), new FileLoggerService() }); List <ICreditManager> credits = new List <ICreditManager>() { ihtiyacCreditManager, tasitCreditManager }; //Liste yolu ile hesaplama //applyManager.CreditOnBilgilendirmesiYap(credits); }
static void Main(string[] args) { ICreditManager ihtiyacCreditManager = new IhtiyacCreditManager(); ICreditManager tasitCreditManager = new TasitCreditManager(); ICreditManager konutCreditManager = new KonutCreditManager(); ICreditManager esnafCreditManager = new EsnafCreditManager(); ILoggerService databaseLoggerService = new DatabaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); ILoggerService smsLoggerService = new SmsLoggerService(); List <ILoggerService> loggers = new List <ILoggerService>() { new SmsLoggerService(), new FileLoggerService() }; BasvuruManager basvuruManager = new BasvuruManager(); basvuruManager.BasvuruYap(esnafCreditManager, loggers); List <ICreditManager> credits = new List <ICreditManager>() { ihtiyacCreditManager, tasitCreditManager }; //basvuruManager.CreditOnBilgilendirmeYap(credits); }
static void Main(string[] args) { ICreditManager transportationCreditManager = new TransportationCreditManager(); ICreditManager needsCreditManager = new NeedsCreditManager(); ICreditManager mortgageCreditManager = new MortgageCreditManager(); ICreditManager esnafCreditManager = new EsnafCreditManager(); // Basvuru sinifimizdan apply i cagirip tasit kredisine basvurttuk. ApplyManager applyManager = new ApplyManager(); applyManager.Apply(esnafCreditManager, new List <ILoggerService> { new DatabaseLoggerService(), new SmsLoggerService() }); // Kullanicinin cekecegi kredi hangisinde daha az masrafli olacaksa onu gormesi icin butun kredilerin tipinde bir liste olusturup bunu bilgi alma methoduna gonderdik. List <ICreditManager> creditList = new List <ICreditManager>(); creditList.Add(transportationCreditManager); creditList.Add(needsCreditManager); creditList.Add(mortgageCreditManager); //applyManager.GiveCreditInformation(creditList); }