static void Main(string[] args) { ILoanManager personalLoanManager = new PersonalLoanManager(); ILoanManager autoLoanManager = new AutoLoanManager(); ILoanManager mortgageLoanManager = new MortgageLoanManager(); ILoggerService databaseLoggerService = new DatabaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); List <ILoggerService> loggers = new List <ILoggerService> { new SmsLoggerService(), new FileLoggerService() }; ApplyManager applyManager = new ApplyManager(); // applyManager.ApplyNow(personalLoanManager,fileLoggerService); //new DatabaseLoggerService() şeklinde de yazılabilir applyManager.ApplyNow(new TradesmenLoanManager(), loggers); // applyManager.ApplyNow(new TradesmenLoanManager(), new List<ILoggerService>(){new DatabaseLoggerService(),new SmsLoggerService()}); List <ILoanManager> loans = new List <ILoanManager>() { personalLoanManager, autoLoanManager }; //applyManager.LoanPrequalificaiton(loans); }
static void Main(string[] args) { //NeedCreditManager needCreditManager = new NeedCreditManager(); //needCreditManager.Calculate(); //VehicleCreditManager vehicleCreditManager = new VehicleCreditManager(); //vehicleCreditManager.Calculate(); //HouseCreditManager houseCreditManager = new HouseCreditManager(); //houseCreditManager.Calculate(); //Şimdi yukarıdaki işlemleri interface tanımlamamızı kullanarak yapalım ICreditManager needCreditManager = new NeedCreditManager(); ICreditManager vehicleCreditManager = new VehicleCreditManager(); ICreditManager houseCreditManager = new HouseCreditManager(); ApplyManager applyManager = new ApplyManager(); //applyManager.MakeAplication(houseCreditManager); // ( ) içinde MakeAplication a hangi krediyi gönderirsek onun hesaplamasını yapar. List <ICreditManager> credits = new List <ICreditManager>() { needCreditManager, vehicleCreditManager }; //Burada ön bilgilendirmesini istediğimiz tüm krediler hesaplanır. applyManager.MakeCreditPreliminaryInformation(credits); }
//Interface static void Main(string[] args) { //Bireysel Kredi ICreditManager personalCreditManager = new PersonalCreditManager(); //Ev Kredisi ICreditManager homeCreditManager = new HomeCreditManager(); //Araba Kredisi ICreditManager carCreditManager = new CarCreditManager(); //Ev Kredisi Basvurusu Yap ApplyManager applyManager = new ApplyManager(); applyManager.Apply(new ArtisanCreditManager(), new List <ILoggerService> { new DatabaseLoggerService(), new SmsLoggerService() }); // çoklu kredi seçip hesaplatarak hangisi uygun kıyaslamak List <ICreditManager> credits = new List <ICreditManager>() { personalCreditManager, homeCreditManager }; applyManager.CreditPreInform(credits); }
static void Main(string[] args) { ICreditManager vehicleCreditManager = new VehicleCreditManager(); ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager(); ApplyManager applyManager = new ApplyManager(); //applyManager.ToApply(personalFinanceCreditManager); //applyManager.ToApply(vehicleCreditManager); DatabaseLoggerService databaseLoggerService = new DatabaseLoggerService(); FileLoggerService fileLoggerService = new FileLoggerService(); applyManager.ToApply(personalFinanceCreditManager, new List <ILoggerService> { databaseLoggerService }); applyManager.ToApply(vehicleCreditManager, new List <ILoggerService> { databaseLoggerService, fileLoggerService }); List <ICreditManager> credits = new List <ICreditManager> { vehicleCreditManager, personalFinanceCreditManager }; //applyManager.CreditPreInformation(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) { /* * burada ilk önce her kredinin ayrı ayrı hesapla methodunu çağırdık * sonra basvuru yap diye bir manager açtık onun içine ortak olan interface ten * türeyen nesne isteyerek hepsi kendi hesaplamarına gitmeyi sağladık * bu dependency injection dır */ //ICreditManager mortgageCredit = new MortgageCreditManager(); //mortgageCredit.Calculate(); //ICreditManager vehicleCredit = new VehicleCreditManager(); //vehicleCredit.Calculate(); //ICreditManager personelCredit = new PersonelCreditManager(); //personelCredit.Calculate(); ICreditManager mortgageCredit = new MortgageCreditManager(); ICreditManager vehicleCredit = new VehicleCreditManager(); ICreditManager personelCredit = new PersonelCreditManager(); ApplyManager applyManager = new ApplyManager(); //applyManager.Apply(personelCredit); /* * Burada ise listeden gelenlerin kredierini hesaplattık */ List <ICreditManager> credits = new List <ICreditManager>() { personelCredit, vehicleCredit, mortgageCredit }; applyManager.DoCreditInformation(credits); //Log kısmı ILoggerService dbloggerService = new DbLoggerService(); ILoggerService fileloggerService = new FileLoggerService(); List <ILoggerService> loggerServices = new List <ILoggerService>() { dbloggerService, fileloggerService }; //applyManager.Apply(personelCredit, loggerServices); }
static void Main(string[] args) { ICreditManager ihtiyacCreditManager = new IhtiyacCreditManager(); ICreditManager tasitCreditManager = new TasitCreditManager(); ICreditManager konutCreditManager = new KonutCreditManager(); ILoggerService fileLoggerService = new FileLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.Applying(ihtiyacCreditManager, new DatabaseLoggerService()); List <ICreditManager> credits = new List <ICreditManager>() { konutCreditManager, tasitCreditManager }; //applyManager.CreditPreInfo(credits); }
static void Main(string[] args) { IhtiyacKrediManager ihtiyacKrediManager = new IhtiyacKrediManager(); TasitKrediManager tasitKrediManager = new TasitKrediManager(); KonutKrediManager konutKrediManager = new KonutKrediManager(); ILoggerService databaseLoggerService = new DatabaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.Apply(ihtiyacKrediManager, databaseLoggerService); List <ICreditManager> credits = new List <ICreditManager>() { ihtiyacKrediManager, tasitKrediManager }; //applyManager.CreditPreInform(credits); }
static void Main(string[] args) { ILoanManager personalFinanceManager = new PersonalFinanceManager(); ILoanManager transportLoanManager = new TransportLoanManager(); ILoanManager mortgageLoanManager = new MortgageLoanManager(); ILoanManager traderLoanManager = new TraderLoanManager(); ILoggerService databaseLoggerService = new DatabaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.BasvuruYap(traderLoanManager, new SmsLoggerService()); //(new DatabaseLoggerService) de olur List <ILoanManager> loans = new List <ILoanManager>() { personalFinanceManager, transportLoanManager }; //applyManager.LoanPreview(loans); }
// Interface ; olusturulurken basına "I" harfi eklenerek yazılır. // interfaceleri birbirinin alternatifi olan ama kod içerikleri farklı olan durumlar için kullanırız. // yaptığımız örnekte bütün kredi türlerinde hesaplama yapılıyor fakat kredinin türüne göre değişkenlik göstereceğinden // farklı türlerde kodlar yazılır. static void Main(string[] args) { ICreditManager personelFinanceCreditManager = new PersonelFinanceCreditManager(); ICreditManager vehicleCreditManager = new VehicleCreditManager(); ICreditManager mortgageCreditManager = new MortgageCreditManager(); ILoggerService databaseLoggerService = new DatabaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.Apply(vehicleCreditManager, fileLoggerService); List <ICreditManager> credits = new List <ICreditManager>() { personelFinanceCreditManager, vehicleCreditManager }; //applyManager.CreditPreInformation(credits); }
static void Main(string[] args) { ICreditManager needCreditManager = new NeedCreditManager(); ICreditManager vehicleCreditManager = new VehicleCreditManager(); ICreditManager housingCreditManager = new HousingCreditManager(); ILoggerService databaseLoggerService = new DatabaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.Apply(new SellerCreditManager(), new SMSLoggerService()); List <ICreditManager> credits = new List <ICreditManager>() { needCreditManager, housingCreditManager }; //applyManager.CreditEarlyBriefing(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); }
static void Main(string[] args) { ICreditBaseManager requirementManager = new RequirementManager(); ICreditBaseManager vehicleCreditManager = new VehicleCreditManager(); ICreditBaseManager housingCreditManager = new HousingCreditManager(); ILoggerService dataBaseLoggerService = new DatabaseLoggerService(); ILoggerService fileBaseLoggerService = new FilebaseLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.Apply(vehicleCreditManager, fileBaseLoggerService); List <ICreditBaseManager> credits = new List <ICreditBaseManager>() { requirementManager, vehicleCreditManager }; }
static void Main(string[] args) { ICreditManager consumerLoanManager = new ConsumerLoanManager(); ICreditManager vehicleLoanManager = new VehicleLoanManager(); ICreditManager mortgageManager = new MortgageManager(); ApplyManager applyManager = new ApplyManager(); ILoggerService databaseLoggerService = new DatabaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); List <ILoggerService> loggers = new List <ILoggerService> { new DatabaseLoggerService(), new FileLoggerService() }; applyManager.Apply(consumerLoanManager, loggers); List <ICreditManager> credits = new List <ICreditManager>() { mortgageManager, vehicleLoanManager }; //applyManager.DoCreditPreİnfo(credits); }
static void Main(string[] args) { ICreditManager financeCreditManager = new FinanceCreditManager(); ICreditManager transportCreditManager = new TransportCreditManager(); ICreditManager mortgageCreditManager = new MortgageCreditManager(); ILoggerService dataBaseLoggerService = new DataBaseLoggerService(); ILoggerService fileLoggerService = new FileLoggerService(); ApplyManager applyManager = new ApplyManager(); applyManager.Apply(transportCreditManager, new List <ILoggerService> { new DataBaseLoggerService(), new SmsLoggerService() }); List <ICreditManager> credits = new List <ICreditManager>() { financeCreditManager, transportCreditManager }; //applyManager.CreditPreInfo(credits); }
//birden fazla class açmamıza polimorfiziim denir //daha koılay olması için birden fazla class açtık static void Main(string[] args) { //ikiside aynı //ConsumerLoanManager consumerLoanManager = new ConsumerLoanManager(); //İnterface onu implemente eden classın referansını tutabilir //Bu bilgi biz işe sokacak bilgidir o yüzden bu çok önemli ILoanManager consumerLoanManager = new ConsumerLoanManager(); ILoanManager carLoanManager = new CarLoanManager(); ILoanManager houseLoanManager = new HouseLoanManager(); ApplyManager applyManager = new ApplyManager(); applyManager.Apply(carLoanManager, new FileLoggerService()); List <ILoanManager> loans = new List <ILoanManager>() { consumerLoanManager, carLoanManager }; //applyManager.LoanPreInformation(loans); //şuan bankadaki görevli kredi bilgilendirmesi için kredileri yolladı }