예제 #1
0
        static void Main(string[] args)
        {
            //interface lerin birbirlerinin alternatifi olan kod içeriklerinin farklı olan kod içerikleri için kullanırız.
            ICreditManager needLoanManager     = new NeedLoanManager();
            ICreditManager vehicleLoanManager  = new VehicleLoanManager();
            ICreditManager mortgageLoanManager = new MortgageLoanManager();
            ICreditManager artisanLoanManager  = new ArtisanLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();
            ILoggerService smsLoggerService      = new SmsLoggerService();

            List <ILoggerService> loggers = new List <ILoggerService>()
            {
                databaseLoggerService, smsLoggerService
            };

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeAnApplication(needLoanManager, loggers); //Hangi class ı gönderirsem onun methodu çalışır.
            applicationManager.MakeAnApplication(artisanLoanManager, loggers);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                needLoanManager, vehicleLoanManager, mortgageLoanManager
            };

            //applicationManager.MakeCreditPreNotification(credits);
        }
예제 #2
0
        private static void Main(string[] args)
        {
            ICreditService financeCreditManager = new FinanceLoanManager();
            ICreditService vehicleLoanManager   = new VehicleLoanManager();
            ICreditService mortgageLoanManager  = new MortgageLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            List <ILoggerService> loggers = new List <ILoggerService> {
                new SmsLoggerService(), new FileLoggerService()
            };                                                                                                           //new SmsLoggerService(), new FileLoggerService()


            RecourseManager recourseManager = new RecourseManager();

            recourseManager.RecourseToLoan(new MortgageLoanManager(), loggers);

            List <ICreditService> creditServices = new List <ICreditService>()
            {
                financeCreditManager, vehicleLoanManager
            };

            recourseManager.LoanPreliminaryInformation(creditServices);


            Console.ReadLine();
        }
예제 #3
0
        static void Main(string[] args)
        {
            ILoanManager consumerLoanManager = new ConsumerLoanManager();
            ILoanManager vehicleLoanManager  = new VehicleLoanManager();
            ILoanManager mortgageLoanManager = new MortgageLoanManager();
            ILoanManager artisanLoanManager  = new ArtisanLoanManager();

            LoanApplicationManager loanApplicationManager = new LoanApplicationManager();
            ILoggerService         databaseLoggerService  = new DatabaseLoggerService();
            ILoggerService         fileLoggerService      = new FileLoggerService();
            ILoggerService         smsLoggerService       = new SmsLoggerService();

            //loanApplicationManager.Apply(vehicleLoanManager);
            //loanApplicationManager.Apply(mortgageLoanManager);
            loanApplicationManager.Apply(consumerLoanManager, new List <ILoggerService> {
                databaseLoggerService, smsLoggerService
            });
            loanApplicationManager.Apply(artisanLoanManager, new List <ILoggerService> {
                new DatabaseLoggerService(), new FileLoggerService()
            });
            loanApplicationManager.Apply(vehicleLoanManager, smsLoggerService);


            List <ILoanManager> loans = new List <ILoanManager>()
            {
                consumerLoanManager, vehicleLoanManager, mortgageLoanManager
            };
            //loanApplicationManager.GiveCreditPreInformation(loans);
        }
예제 #4
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceLoanManager = new PersonalFinanceLoanManager();
            ICreditManager vehicleLoanManager         = new VehicleLoanManager();
            ICreditManager mortgageLoanManager        = new MortgageLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            List <ILoggerService> loggers = new List <ILoggerService>()
            {
                new SmsLoggerService(), new FileLoggerService(), new DatabaseLoggerService()
            };

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Apply(personalFinanceLoanManager, loggers);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalFinanceLoanManager, vehicleLoanManager, mortgageLoanManager
            };

            //applicationManager.GiveCreditPreInformation(credits);
        }
예제 #5
0
        static void Main(string[] args)
        {
            ICreditManager consumerLoanManager = new ConsumerLoanManager();
            ICreditManager vehicleLoanManager  = new VehicleLoanManager();
            ICreditManager mortgageLoanManager = new MortgageLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();
            //burada instance oluşturmak yerine örneğin 19.satırda parantez içine new FileLoggerService() yazabilirdik

            ICreditManager craftLoanManager = new CraftLoanManager();

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Apply(craftLoanManager, new List <ILoggerService> {
                new DatabaseLoggerService(), new FileLoggerService()
            });
            //parantez içinde öncelikle kredi türleri için hangi metottan istem yaptıysak onu yazdırdı
            //burada birden fazla logger çalıştırdığımız için, aynı kredilerde olduğu gibi foreach kullanıp logger listesinde döndük.

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                consumerLoanManager, vehicleLoanManager
            };

            //applicationManager.DoCreditPreinformation(credits);
        }
예제 #6
0
        static void Main(string[] args)
        {
            //ConsumerLoanManager consumerLoanManager = new ConsumerLoanManager();
            //consumerLoanManager.Calculate();

            //VehicleLoanManager vehicleLoanManager = new VehicleLoanManager();
            //vehicleLoanManager.Calculate();

            //MortgageLoanManager mortgageLoanManager = new MortgageLoanManager();
            //mortgageLoanManager.Calculate();


            //Interfaceler diger classlardaki inherite olabilir. Cunku tum kredi hesaplama yontemlerinde miras almistir.

            //ILoanBaseManager consumerLoanManager1 = new ConsumerLoanManager();
            //consumerLoanManager1.Calculate();

            //ILoanBaseManager vehicleLoanManager1 = new VehicleLoanManager();
            //vehicleLoanManager1.Calculate();

            //ILoanBaseManager mortgageLoanManager1 = new MortgageLoanManager();
            //mortgageLoanManager1.Calculate();



            ILoanBaseManager consumerLoanManager2  = new ConsumerLoanManager();
            ILoanBaseManager vehicleLoanManager2   = new VehicleLoanManager();
            ILoanBaseManager mortgageLoanManager2  = new MortgageLoanManager();
            ILoanBaseManager tradesmanLoanManager2 = new TradesmanLoanManager();


            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();
            ILoggerService smsLoggerService      = new SmsLoggerService();

            List <ILoggerService> services = new List <ILoggerService>()
            {
                databaseLoggerService, smsLoggerService
            };

            CreditApplicationManager creditApplicationManager = new CreditApplicationManager();

            //creditApplicationManager.CreditApplication(consumerLoanManager2, databaseLoggerService);

            creditApplicationManager.CreditApplication(tradesmanLoanManager2, services);

            List <ILoanBaseManager> loans = new List <ILoanBaseManager>()
            {
                consumerLoanManager2, vehicleLoanManager2, mortgageLoanManager2
            };
            //creditApplicationManager.ProvideCreditPreNotification(loans);

            //Interfaceleri birbirinin alternatifi olan ama kod icerikleri birbirinden farkli olan durumlar icin kullaniriz.
            //Bu yaptigimiz ornekte tum krediler hesaplama ortak bir nokta vardir. Ancak kodlari farkli kurallari vardir.
            //Kredinin turlerine hesaplama turleri degiskenlik gosterir.
        }
예제 #7
0
        static void Main(string[] args)
        {
            ConsumerLoanManager consumerLoanManager = new ConsumerLoanManager();

            consumerLoanManager.Calculate();

            VehicleLoanManager vehicleLoanManager = new VehicleLoanManager();

            vehicleLoanManager.Calculate();

            MortgageManager mortgageManager = new MortgageManager();

            mortgageManager.Calculate();

            ICreditManager consumerLoanManager2 = new ConsumerLoanManager();

            consumerLoanManager.Calculate();

            ICreditManager vehicleLoanManager2 = new VehicleLoanManager();

            vehicleLoanManager.Calculate();

            ICreditManager mortgageManager2 = new MortgageManager();

            mortgageManager.Calculate();

            // Interface olarak oluşturmak da aynı işlevi görür, interface onu inheritance eden classları tutabilir

            ILoggerService databaseLoggerManager = new DatabaseLoggerManager();
            ILoggerService fileLoggerManager     = new FileLoggerManager();

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Apply(consumerLoanManager, new List <ILoggerService> {
                new DatabaseLoggerManager(), new FileLoggerManager()
            });;
            applicationManager.Apply(vehicleLoanManager, new List <ILoggerService>());
            applicationManager.Apply(mortgageManager, new List <ILoggerService>());
            applicationManager.Apply(consumerLoanManager2, new List <ILoggerService>());
            applicationManager.Apply(vehicleLoanManager2, new List <ILoggerService>());
            applicationManager.Apply(mortgageManager2, new List <ILoggerService>());


            Console.WriteLine("\n\n\n\n -------------------------------- \n\n\n\n");


            List <ICreditManager> credits = new List <ICreditManager>()
            {
            };

            credits.Add(consumerLoanManager2);
            credits.Add(vehicleLoanManager2);

            applicationManager.InformAboutCredit(credits);
        }
예제 #8
0
        static void Main(string[] args)
        {
            //GeneralLoanManager generalLoanManager = new GeneralLoanManager(); alttaki ile aynı.İnterfacelerde o interfacei implemente eden classın referans numarasını tutabiliyomuş.
            //ICreditManager generalLoanManager = new GeneralLoanManager();
            //generalLoanManager.Calculate();

            //VehicleLoanManager vehicleLoanManager = new VehicleLoanManager();
            //ICreditManager vehicleLoanManager = new VehicleLoanManager();
            //vehicleLoanManager.Calculate();

            //MortgageLoanManager mortgageLoanManager = new MortgageLoanManager();
            //ICreditManager mortgageLoanManager = new MortgageLoanManager();
            //mortgageLoanManager.Calculate();


            //Kullanıcı ekranında bu krediler seçenek
            ICreditManager generalLoanManager  = new GeneralLoanManager();
            ICreditManager vehicleLoanManager  = new VehicleLoanManager();
            ICreditManager mortgageLoanManager = new MortgageLoanManager();

            //ApplicationManager applicationManager = new ApplicationManager();
            //applicationManager.MakeApplication(generalLoanManager);   //yani ekranda ihtiyaç kredisi seçildiğinde o kredinin hesapla fon ekrana yazılır.

            //List<ICreditManager> loans = new List<ICreditManager>() { }; //kullanıcı kendi durumuna göre krediler asında filtrelem yapıldı ekranda seçilen krediler listelenerek ödeme hesabı yapıldı
            //applicationManager.MakeCreditPrenotification(loans);

            //Loglama kim ne zaman hangi operasyonu çağırdı, sistemde olan hareketlerin dokümanı.Loglama, dosya, veritabanı olarak tuutulabilir veya sms olarak tutulabilir.


            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();
            ILoggerService smsLoggerService      = new SmsLoggerService();


            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeApplication(new VehicleLoanManager(), smsLoggerService); //tasit kredisi yolllanna kişiye smsde yolla.  VehicleLoanManager için yeni instance burda da bu şekilde oluşturulabilir.



            //Birden fazla logger yollama
            //List<ILoggerService> loggers = new List<ILoggerService> { new SmsLoggerService(), new FileLoggerService() };


            //ApplicationManager applicationManager = new ApplicationManager();
            //applicationManager.MakeApplication(new MortgageLoanManager(), loggers);

            //List<ICreditManager> loans = new List<ICreditManager>() { VehicleLoanManager, GeneralLoanManager };

            //applicationManager.MakeCreditPrenotification(loans);
        }
예제 #9
0
파일: Program.cs 프로젝트: omrbln/KampIntro
        static void Main(string[] args)
        {
            //ConsumerLoanManager consumerLoanManager = new ConsumerLoanManager();
            //consumerLoanManager.Calculate();

            //VehicleLoanManager vehicleLoanManager = new VehicleLoanManager();
            //vehicleLoanManager.Calculate();

            //MortgageLoanManager mortgageLoanManager = new MortgageLoanManager();
            //mortgageLoanManager.Calculate();

            //Yukarıdaki ve aşağıdaki ifadeler birebir aynı şeyi ifade ediyor

            //ILoanManager consumerLoanManager = new ConsumerLoanManager();
            //consumerLoanManager.Calculate();

            //ILoanManager vehicleLoanManager = new VehicleLoanManager();
            //vehicleLoanManager.Calculate();

            //ILoanManager mortgageLoanManager = new MortgageLoanManager();
            //mortgageLoanManager.Calculate();



            ILoanManager consumerLoanManager = new ConsumerLoanManager();
            ILoanManager vehicleLoanManager  = new VehicleLoanManager();
            ILoanManager mortgageLoanManager = new MortgageLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            List <ILoggerService> loggers = new List <ILoggerService> {
                new SmsLoggerService(), new FileLoggerService()
            };

            AppealManager appealManager = new AppealManager();

            appealManager.MakeAnApplication(new TradesmanLoanManager(), loggers);

            List <ILoanManager> loans = new List <ILoanManager>()
            {
                consumerLoanManager, vehicleLoanManager, mortgageLoanManager
            };

            //appealManager.MakeLoanPrenotification(loans);
        }
예제 #10
0
        static void Main(string[] args)
        {
            RequirementLoanManager requirementLoanManager = new RequirementLoanManager();
            VehicleLoanManager     vehicleLoanManager     = new VehicleLoanManager();
            MortgageLoanManager    mortgageLoanManager    = new MortgageLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            RecourseManager recourseManager = new RecourseManager();

            recourseManager.MakeAnApplication(mortgageLoanManager, databaseLoggerService);  //It calculates whatever loan is sent from the RecourseManager

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                requirementLoanManager, vehicleLoanManager
            };
            //recourseManager.DoCreditPreinformation(credits);
        }
예제 #11
0
        static void Main(string[] args)
        {
            ICreditManager personalLoanCreditManager = new PersonalLoanCreditManager();
            ICreditManager mortgageCreditManager     = new MortgageCreditManager();
            ICreditManager vehicleLoanManager        = new VehicleLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.BasvuruYap(personalLoanCreditManager, new DatabaseLoggerService());

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalLoanCreditManager, vehicleLoanManager
            };
            //  applicationManager.KrediOnBilgilendirmesiYap(credits);
        }
예제 #12
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();

            ICreditManager vehicleLoanManager = new VehicleLoanManager();

            ICreditManager mortgageLoanManager = new MortgageLoanManager();



            LoanApplication application = new LoanApplication();

            application.Application(vehicleLoanManager, new DataBaseLoggerService());

            List <ICreditManager> credits = new List <ICreditManager> {
                mortgageLoanManager, vehicleLoanManager
            };

            //application.CreditInformation(credits);
        }
예제 #13
0
        static void Main(string[] args)
        {
            ILoanManager personalLoanManager = new PersonalLoanManager();

            ILoanManager vehicleLoanManager = new VehicleLoanManager();

            ILoanManager mortgageManager = new MortgageManager();

            LoanApplicationManager loanApplicationManager = new LoanApplicationManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            loanApplicationManager.Apply(vehicleLoanManager, databaseLoggerService);

            List <ILoanManager> loans = new List <ILoanManager>()
            {
                mortgageManager, vehicleLoanManager
            };
            //loanApplicationManager.LoanPreCalculation(loans);
        }
예제 #14
0
        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);
        }
예제 #15
0
        static void Main(string[] args)
        {
            ILoanManager needLoanManager     = new NeedLoanManager();
            ILoanManager vehicleLoanManager  = new VehicleLoanManager();
            ILoanManager mortgageLoanManager = new MortgageLoanManager();
            ILoanManager esnafLoanManager    = new EsnafLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();
            ILoggerService smsLoggerService      = new SmsLoggerService();

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.ToApply(esnafLoanManager, smsLoggerService);
            //applicationManager.ToApply(needLoanManager);

            List <ILoanManager> loans = new List <ILoanManager>()
            {
                needLoanManager, vehicleLoanManager
            };

            //applicationManager.LoanInformation(loans);
        }
예제 #16
0
        static void Main(string[] args)
        {//interface, onu implemente eden classın referansını tutabilir
            ICreditManager personalFinance = new PersonalFinanceCreditManager();
            ICreditManager vehicle         = new VehicleLoanManager();
            ICreditManager realEstate      = new RealEstateLoansManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            ApplicationManager applicationManager = new ApplicationManager();


            applicationManager.Applicate(new ArtisanCreditManager(), new List <ILoggerService> {
                databaseLoggerService, new SmsLoggerService()
            });
            //applicationManager.Applicate(realEstate);
            //applicationManager.Applicate(vehicle);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalFinance, vehicle
            };
            // applicationManager.CreditPreInforming(credits);
        }
예제 #17
0
        static void Main(string[] args)
        {
            ICreditManager ConsumerLoanManager = new ConsumerLoanManager();
            ICreditManager VehicleLoanManager  = new VehicleLoanManager();
            ICreditManager MortageLoanManager  = new MortageLoanManager();
            ICreditManager ArtisanLoanManager  = new ArtisanLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLoggerService     = new FileLoggerService();

            List <ILoggerService> loggers = new List <ILoggerService> {
                new SmsLoggerService(), new FileLoggerService()
            };

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Apply(ArtisanLoanManager, loggers);
            List <ICreditManager> credits = new List <ICreditManager>()
            {
                ConsumerLoanManager, VehicleLoanManager
            };

            //applicationManager.CreditPreNotification(credits);
        }
예제 #18
0
        static void Main(string[] args)
        {
            ILoanManager personalFinanceLoan  = new PersonalFinanceLoan();
            ILoanManager vehicleLoanManager   = new VehicleLoanManager();
            ILoanManager housingLoanManager   = new HousingLoanManager();
            ILoanManager tradesmanLoanManager = new TradesmanLoanManager();

            ILoggerService databaseLoggerService = new DatabaseLoggerService();
            //veya 22. satir virgulden sonrasi gibi de yazabilirsin
            ILoggerService fileLoggerService = new FileLoggerService();
            ILoggerService smsLoggerService  = new SmsLoggerService();

            RecourseManager recourseManager = new RecourseManager();

            recourseManager.MakeRecourse(tradesmanLoanManager, smsLoggerService);

            List <ILoanManager> loans = new List <ILoanManager>()
            {
                personalFinanceLoan,
                vehicleLoanManager
            };

            //recourseManager.PreLoanInfo(loans);
        }