Beispiel #1
0
        static void Main(string[] args)
        {
            ICreditManager financeCreditManager = new FinanceCreditManager();
            //financeCreditManager.Calculate();
            ICreditManager transportCreditManager = new TransportCreditManager();
            //transportCreditManager.Calculate();
            ICreditManager mortageCreditManager = new MortageCreditManager();
            //mortageCreditManager.Calculate();


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


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



            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeAnApplication(new ArtisanCredit(), loggers);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                transportCreditManager, mortageCreditManager
            };
            //applicationManager.MakeCreditPrenotification(credits);
        }
        static void Main(string[] args)
        {
            PersonalFinanceCreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            TransportCreditManager       transportCreditManager       = new TransportCreditManager();
            MortgageLoanManager          mortgageLoanManager          = new MortgageLoanManager();


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


            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeAnApplication(personalFinanceCreditManager, new List <ILoggerService>()
            {
                fileLoggerService, databseLoggerService
            });



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

            applicationManager.MakeCreditPreNotification(credits);
        }
        static void Main(string[] args)
        {
            ICreditManager demandCreditManager    = new DemandCreditManager();
            ICreditManager transportCreditManager = new TransportCreditManager();
            ICreditManager houseCreditManager     = new HouseCreditManager();
            ICreditManager artisanCreditManager   = new ArtisanCreditManager();

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

            List <ILoggerService> loggerServices = new List <ILoggerService> {
                smsLoggerService, fileLoggerService, databaseLoggerService
            };

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.DoApplication(artisanCreditManager, loggerServices);

            List <ICreditManager> credits = new List <ICreditManager> {
                demandCreditManager, houseCreditManager, transportCreditManager
            };

            //applicationManager.DoCreditPreinformation(credits);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            ICreditManager personelCreditManager  = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager = new TransportCreditManager();
            ICreditManager mortgageLoanManager    = new MortgageLoanManager();


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

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

            ApplicationManager applicationManager = new ApplicationManager();

            //applicationManager.MakeAnApplication(personelCreditManager, fileLoggerService);
            applicationManager.MakeAnApplication(new ArtisanLoanManager(), loggers);

            //applicationManager.MakeAnApplication(personelCreditManager, databaseLoggerService);
            //applicationManager.MakeAnApplication(mortgageLoanManager);
            //applicationManager.MakeAnApplication(transportCreditManager);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personelCreditManager, transportCreditManager
            };
            // applicationManager.CreditPreNotification(credits);
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            ICreditManager personalCreditManager  = new PersonalCreditManager();
            ICreditManager transportCreditManager = new TransportCreditManager();
            ICreditManager mortgageCreditManager  = new MortgageCreditManager();
            ICreditManager tradesCreditManager    = new TradesCreditManager();

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

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

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeApplication(personalCreditManager, loggers);

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

            //applicationManager.Creditİnformation(credits);
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortgageLoanCreditManager    = new MortgageLoanCreditManager();
            ICreditManager artisanLoanCreditManager     = new ArtisanLoanCreditManager();

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

            List <ILoggerService> logger = new List <ILoggerService>()
            {
                databaseLoggerService, smsloggerService
            };

            RecourseManager recourseManager = new RecourseManager();

            recourseManager.ToApply(transportCreditManager, new List <ILoggerService> {
                fileLoggerService
            });
            Console.WriteLine("------------------------------------");
            recourseManager.ToApply(artisanLoanCreditManager, logger);

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

            //recourseManager.CreditPreNotification(credits);
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            //PersonalFinanceCreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            //personalFinanceCreditManager.Calculate();

            //TransportCreditManager transportCreditManager = new TransportCreditManager();
            //transportCreditManager.Calculate();

            //MortageLoanManager mortageLoanManager = new MortageLoanManager();
            //mortageLoanManager.Calculate();


            // Interface lerde imlemente edildiği Clasın referans numarasını tutar.
            // Yukarıda ki kullanımda doğru  aşağıdaki kullanımda


            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortageLoanManager           = new MortageLoanManager();
            ILoggerService dataLoggerService            = new DatabaseLoggerService();
            ILoggerService filLoggerService             = new FileLoggerService();

            // şimdi çok güzel bir şekilde yapı kurduk istersek kodumuzu hiç değiştirmeden sadece class ekleyip yeni kredi türleri ve loglama işlemi yapabiliriz.
            // SOLID kurallarının O kısmı bu
            ICreditManager tradesmanLoanManager = new TradesmanLoanManager();
            ILoggerService smsLoggerService     = new SmsLoggerService();

            // ***** interfaceleri biribirinin alternatifi olan ama kod içerikleri farklı olan içerikler için kullanırız.
            // projemizde loglama yapmak istiyoruz. Loglama:Kim ne zaman hangi operasyonu çağırdı.
            // Loglarımızı bir dosyada tutabiliriz
            // loglarımızı veri tabanında tutabiliriz.
            // loglarımızı sms olarakta atabiliriz vb şeyler.
            // İstenebilir hepsi aynı şeyi loglamayı yapıyor ama farklı işlemler yani interface kullanırız.
            // bizden 1 tanesi bile istense interface kullanmamız lazım ileride değişiklik istediğini düşün
            // müşterinin interfacesiz yaparsan bütün sistemin gidebilir tekrar uğraşırsın

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

            List <ICreditManager> creditManagers = new List <ICreditManager>()
            {
                new PersonalFinanceCreditManager(),
                new TransportCreditManager()
            };
            // recourseManager.KrediOnBilgilendirmesiYap(creditManagers);


            RecourseManager recourseManager = new RecourseManager();

            recourseManager.BasvuruYap(tradesmanLoanManager, loggerServices);

            // Senaryomuz şu bir müşteririmiz var bankaya kredi çekmeye gidiyor araba kredisi çekicek bankacı soruyor taşıt kredisimi istersiniz yoksa ihtiyaç kredisimi diye
            // şimdi tek kredi hesaplama yapabiliyoruz ama burda 2 tane kredi aynı anda istendi bu yüzden aşağıdki işlemi yapıyoruz.
            // 2 değil 100 de istenebilir 1000 de vb. bu yüzden herşeyi düşünerek yazılması lazım
            // aşağıdaki mantık bi liste ytanımladık içine Bizim kredilerin babası sayılan ICreditManager ı attık yani istediğimiz bütün kredileri kolaylıkla çağırabiliriz.
            // sonrada RecourseManagerda yazdığımız fonksiyonumuzu çağırdık bu fonksiyonda da parametre olarak list ICreditManager verdik böylece bütün kredileri çağırabilmemizi sağladık.
        }
Beispiel #8
0
        static void Main(string[] args)
        {
            //Bunlar şubedeki arkadaşın secebileceği kredi seçenekleri
            ICreditManager ihtiyacKrediManager    = new İhtiyacKrediManager(); //İnterfaceler, o interfaceyi implemente eden classin referans numarasını tutabilir.
            ICreditManager mortgageCreditManager  = new MortgageCreditManager();
            ICreditManager transportCreditManager = new TransportCreditManager();


            CreditApplicationManager creditApplicationManager = new CreditApplicationManager();
            DatabaseLoggerService    databaseLoggerService    = new DatabaseLoggerService(); //aslında alternatif olarak alt satırdaki kodda parametreye "new DatabaseLoggerService()" girilebilir.

            creditApplicationManager.BasvuruYap(ihtiyacKrediManager, databaseLoggerService); //çıktı ihtiyac kredisi hesaplandı!

            //ICreditManager'de bir veri tipidir.
            List <ICreditManager> credits = new List <ICreditManager>()
            {
                ihtiyacKrediManager, mortgageCreditManager, transportCreditManager
            };

            Console.WriteLine("Liste tipinde birden çok kredi türünü hesaplama!: ");
            creditApplicationManager.CreditPreNotification(credits);

            Console.WriteLine("---------------------");
            MortgageCreditManager mortgageCreditManager1 = new MortgageCreditManager();

            creditApplicationManager.BasvuruYap(mortgageCreditManager1, new FileLoggerService());
        }
Beispiel #9
0
        static void Main(string[] args)
        {
            ICreditManager personelFinanceCreditManager = new PersonelFinanceCreditManager();
            //personelFinanceCreditManager.Calculate();
            ICreditManager transportCreditManager = new TransportCreditManager();
            //transportCreditManager.Calculate();
            ICreditManager mortgageCreditManager = new MortgageCreditManager();
            //mortgageCreditManager.Calculate();


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



            ApplicationManager applicationManager = new ApplicationManager();



            applicationManager.Apply(new ArtisanCreditManager(),
                                     new List <ILoggerService> {
                new DatabaseLoggerService(), new SmsLoggerService()
            });



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

            credits.Add(personelFinanceCreditManager);
            credits.Add(transportCreditManager);
            //applicationManager.MakeCreditPreInform(credits);
        }
Beispiel #10
0
        static void Main(string[] args)
        {
            //Interfaceler tuttukları classların referans numaralarını tutabilirler.

            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortgageCreditManager        = new MortgageCreditManager();
            ICreditManager artisanCreditManager         = new ArtisanCreditManager();

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

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


            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Application(artisanCreditManager, loggerServices);

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


            //applicationManager.CreditPreInformation(credits);
        }
Beispiel #11
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            //personalFinanceCreditManager.Calculate();

            ICreditManager transportCreditManager = new TransportCreditManager();
            //transportCreditManager.Calculate();

            ICreditManager mortgageManager = new MortgageManager();
            //mortgageManager.Calculate();

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

            ApplicationManager applicationManager = new ApplicationManager();

            //applicationManager.Application(personalFinanceCreditManager);
            applicationManager.Application(transportCreditManager, fileLoggerService);
            applicationManager.Application(mortgageManager, databaseLoggerService);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalFinanceCreditManager, transportCreditManager, mortgageManager
            };
            //applicationManager.CreditInfo(credits);
        }
Beispiel #12
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortgageLoanManager          = new MortgageLoanManager();

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

            AppealManager appealManager = new AppealManager();

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

            appealManager.MakeApp(mortgageLoanManager, loggers);
            //appealManager.MakeApp(mortgageLoanManager, new DatabaseLoggerService()); bu şekildede yapılabilir *1* işaret, olan satır kullanılmadan

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalFinanceCreditManager, transportCreditManager
            };
            //appealManager.CreditPriorKnowledge(credits);
        }
Beispiel #13
0
        //Interfaceses
        static void Main(string[] args)
        {
            //** ICreditManager dan referans alındı...//**//
            ICreditManager personalCreditManager  = new PersonalCreditManager();
            ICreditManager transportCreditManager = new TransportCreditManager();
            ICreditManager mortgageCreditManager  = new MortgageCreditManager();

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


            AplicationManager aplicationManager = new AplicationManager();

            aplicationManager.MakeAnApplication(mortgageCreditManager, new DatabaseLoggerService());

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalCreditManager
            };
            //aplicationManager.CreditInfo(credits);



            //**1.Yöntem iptal**//
            // PersonalCreditManager personalCreditManager = new PersonalCreditManager();
            //** personalCreditManager.Calculate(); **Aşağıda Referans alındı bu satır aşağıdan silindi.

            // TransportCreditManager transportCreditManager = new TransportCreditManager();
            //**transportCreditManager.Calculate(); **Aşağıda Referans alındı bu satır aşağıdan silindi.

            // MortgageCreditManager mortgageCreditManager = new MortgageCreditManager();
            //** mortgageCreditManager.Calculate(); **Aşağıda Referans alındı bu satır aşağıdan silindi.
        }
Beispiel #14
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortgageCreditManager        = new MortgageCreditManager();

            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.Apply(new ArtisanCreditManager(), loggers);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalFinanceCreditManager, transportCreditManager
            };
            //applicationManager.MakeCreditPreNotification(credits);
        }
Beispiel #15
0
        static void Main(string[] args)
        {
            PersonalFinanceCreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            TransportCreditManager       transporterCreditManager     = new TransportCreditManager();
            MortageManager     mortageManager     = new MortageManager();
            ApplicationManager applicationManager = new ApplicationManager();

            ILoggerService fileLogerService = new FileLoggerService();

            applicationManager.Apply(mortageManager, new DataBaseLoggerService());

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                mortageManager, personalFinanceCreditManager
            };
            //applicationManager.KrediOnBilgilendirmesiYap(credits);
        }
Beispiel #16
0
        static void Main(string[] args)
        {
            /*
             * PersonelFinanceCreditManager personelFinanceCreditManager = new PersonelFinanceCreditManager();
             * personelFinanceCreditManager.Calculate();
             *
             * TransportCreditManager transportCreditManager = new TransportCreditManager();
             * transportCreditManager.Calculate();
             *
             * MortgageCreditManager mortgageCreditManager = new MortgageCreditManager();
             * mortgageCreditManager.Calculate();
             */

            //Görüldüğü üzere 3 yerde ICreditManager'ı implemente ettiği için ICreditManager'dan hepsini türetebilirim.
            ICreditManager personelFinanceCreditManager = new PersonelFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortgageCreditManager        = new MortgageCreditManager();

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

            ApplicationManager applicationManager = new ApplicationManager();

            //aşağıdaki şekilde de yazabilirim alternatifi(Not:List yaptım ondan hata verir)
            //applicationManager.MakeAnApplication(mortgageCreditManager, databaseLoggerService);
            //<applicationManager.MakeAnApplication(mortgageCreditManager, new DatabaseLoggerService());

            //List<ILoggerService> loggerServices = new List<ILoggerService>() { databaseLoggerService, fileLoggerService };
            //applicationManager.MakeAnApplication(transportCreditManager, loggerServices);

            //Hemen üstündeki 2 satırın alternatifidir. Tek satır yazılmak istenince
            applicationManager.MakeAnApplication(transportCreditManager, new List <ILoggerService>()
            {
                databaseLoggerService, fileLoggerService, smsLoggerService
            });


            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personelFinanceCreditManager, transportCreditManager
            };
            //applicationManager.MakeCreditPreNotification(credits);
        }
Beispiel #17
0
        static void Main(string[] args)
        {
            ICreditManager personelCreditManager  = new PersonalFinanceCredit();
            ICreditManager transportCreditManager = new TransportCreditManager();
            ICreditManager housingLoanManager     = new HousingLoanManager();

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


            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeAnApplication(transportCreditManager, fileLoggerService);

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personelCreditManager, transportCreditManager
            };
            //applicationManager.MakeCreditPreNotification(credits);
        }
Beispiel #18
0
        static void Main(string[] args)
        {
            ICreditManager needLoanManager        = new NeedLoanManager();
            ICreditManager transportCreditManager = new TransportCreditManager();
            ICreditManager mortgageLoanManager    = new MortgageLoanManager();

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeApplication(needLoanManager, new List <ILoggerService> {
                new DatabaseLoggerService(), new FileLoggerService()
            });

            List <ICreditManager> credits = new List <ICreditManager> {
                needLoanManager, transportCreditManager
            };

            //applicationManager.CreditPreliminaryInformation(credits);

            Console.ReadLine();
        }
Beispiel #19
0
        static void Main(string[] args)
        {
            ICreditManager personalCreditManager  = new PersonalCreditManager();
            ICreditManager transportCreditManager = new TransportCreditManager();
            ICreditManager mortgageLoanManager    = new MortgageLoanManager();

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

            ReferenceManager referenceManager = new ReferenceManager();

            referenceManager.ToApply(transportCreditManager, databaseLoggerService);
            //seçilen kredi hesaplama seçilen database loglama

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

            //referenceManager.MakeCreditAdvanceNotification(credits);
        }
Beispiel #20
0
        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);
        }
Beispiel #21
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortgageCreditManager        = new MortgageCreditManager();

            ILoggerService dataBaseLoggerService = new DatabaseLoggerService();
            ILoggerService fileLogerService      = new FileLoggerService();

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Apply(new TradesmanCreditManager(), new List <ILoggerService> {
                new DatabaseLoggerService(), new SmsLoggerService()
            });

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

            //applicationManager.GiveCreditPreliminaryInformation(credits);
        }
Beispiel #22
0
        static void Main(string[] args)
        {
            //PersonalFinanceCreditManager personalFinanceCreditManager1 = new PersonalFinanceCreditManager();
            //personalFinanceCreditManager1.Calculate();

            //TransportCreditManager transportCreditManager1 = new TransportCreditManager();
            //transportCreditManager1.Calculate();

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

            ///////////////////////////////////////////////////////////////////////////////////////////////////////

            ILoanManager personalFinanceCreditManager2 = new PersonalFinanceCreditManager();
            ILoanManager transportCreditManager2       = new TransportCreditManager();
            ILoanManager mortgageLoanManager2          = new MortgageLoanManager();

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

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

            appealManager.DoAppeal(mortgageLoanManager2, loggers);
            //appealManager.DoAppeal(new ArtisanLoanManager(), new List<ILoggerService> { databaseLoggerService, smsLoggerService });

            // Polymorphism

            List <ILoanManager> loans = new List <ILoanManager>()
            {
                personalFinanceCreditManager2, transportCreditManager2
            };

            //appealManager.DoCreditPreliminaryInformation(loans);
        }
Beispiel #23
0
        static void Main(string[] args)
        {
            ICreditManager personelFinanceCreditManager = new PersonelFinanceCreditManager();
            ICreditManager transportCreditManager       = new TransportCreditManager();
            ICreditManager mortgageCreditManager        = new MortgageCreditManager();

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


            ConsultManager consultManager = new ConsultManager();

            consultManager.ToApply(personelFinanceCreditManager, new List <ILoggerService> {
                new DatabaseLoggerService(), new FileLoggerService()
            });

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

            // consultManager.CreditPrenotification(credits);
        }
Beispiel #24
0
        static void Main(string[] args)
        {
            ICreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();
            //personalFinanceCreditManager.Calculate();

            ICreditManager transportCreditManager = new TransportCreditManager();
            //transportCreditManager.Calculate();

            ICreditManager mortgageCreditManager = new MortgageCreditManager();
            //mortgageCreditManager.Calculate();

            ILoggerServices databaseLoggerServices = new DatabaseLoggerServices();
            ILoggerServices fileLoggerServices     = new FileLoggerServices();

            AplicationManager aplicationManager = new AplicationManager();

            aplicationManager.DoAplication(new ArtisanCreditManager(), new SmsLoggerServices());

            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personalFinanceCreditManager, transportCreditManager
            };
            //aplicationManager.MakeCreditPreliminaryInformation(credits);
        }
Beispiel #25
0
        static void Main(string[] args)
        {
            PersonelCreditManager  personelCreditManager  = new PersonelCreditManager();
            TransportCreditManager transportCreditManager = new TransportCreditManager();
            HouseCreditManager     houseCreditManager     = new HouseCreditManager();

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

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

            ApplicantManager applicantManager = new ApplicantManager();

            applicantManager.MakeApplication(houseCreditManager, loggers);


            List <ICreditManager> credits = new List <ICreditManager>()
            {
                personelCreditManager, transportCreditManager, houseCreditManager
            };
            //applicantManager.CreditInformation(credits);
        }
Beispiel #26
0
        static void Main(string[] args)
        {
            //---------INTERFACES-----------//----------POLIMORFISM-----------//

            // Yıldızlı not - Interface'leri birbirinin alternatifi olan ama kod içerikleri farklı olan durumlar için kullanırız!

            // Interface'ler de o interface'i implemente eden class'ı ve yani referansını tutabiliyorlar.

            // Loglama - kim ne zaman hangi operasyonu çağırdı; sistemde olan hareketlerin dökümüdür. Veri tabanı, dosya, sms, mail olarak tutulabilir.

            // Mesela Log için de interface kullanılır. Farklı tutma yolları için.



            //- PersonalFinanceCreditManager ihtiyacKrediManager = new PersonalFinanceCreditManager();
            //- ihtiyacKrediManager.Calculate();

            //- TransportCreditManager tasitKrediManager = new TransportCreditManager();
            //- tasitKrediManager.Calculate();

            //- MortgageLoanManager konutKrediManager = new MortgageLoanManager();
            //- konutKrediManager.Calculate();

            // Bu şekilde ekrana kredilerin içindeki kodu yazdıracaktır.

            // Ancak önemli nokta şudur ki:

            //- ICreditManager ihtiyacKredisiManager = new PersonalFinanceCreditManager();
            //- ihtiyacKredisiManager.Calculate();

            // Hepsi interface'imizi kullanarak da aynen çalışabilir.
            //
            //

            //---------------------CreditApplicationManager düzenledikten sonra ise şunu yaptık----------------------//

            ICreditManager konutKrediManager   = new MortgageLoanManager();
            ICreditManager ihtiyacKrediManager = new PersonalFinanceCreditManager();
            ICreditManager tasitKrediManager   = new TransportCreditManager();

            // Bunların ekrandaki açılır kutu ve seçenekleri olduğunu düşünelim.


            ILoggerService databaseLoggerService = new DatabaseLoggerService(); // bunları da oluşturduğumuz için sonradan newledik.
            ILoggerService fileLoggerService     = new FileLoggerService();     //
            ILoggerService smsLoggerService      = new SmsLoggerService();      // bunlar üç loglama alternatifi

            // Birden fazla loglama için liste, şimdi aşağıda başvuru yerinin ikinci parametresi loggers yapmak yeterli olacak.
            List <ILoggerService> loggers = new List <ILoggerService> {
                fileLoggerService, databaseLoggerService, smsLoggerService
            };                                                                                                                      // neleri istersek ekleriz.


            CreditApplicationManager creditApplicationManager = new CreditApplicationManager();

            creditApplicationManager.MakeAnApplication(tasitKrediManager, loggers); // databaseLogger ve fileLogger oluşturunca istedi, parametreye ekledik

            // Yukarıda ise kullanıcının kredilerden birini seçtiğini, bu seçim ile de üstteki parametreye o seçimin eklendiğini düşünelim.
            // Bu kod kredi başvuru class'ına gider ve orada da taşıt kredisi atandığı için taşıt kredisi class'ının hesaplaması çalışır.
            // Bu yüzden de ekrana sadece Taşıt kredisi ödeme planı hesaplandı yazar.

            // Soyutlama yani bu OOP3 Projesinde anlatılanlar son derece önemlidir. İşe kabul ettirecek bilgilerdir.


            // Kredi ön bilgilendirmesi yap kısmından sonra buraya geldik. Orada parametre içine sayısı belirsiz olduğu için List yapmıştık.
            List <ICreditManager> krediler = new List <ICreditManager>()
            {
                tasitKrediManager, ihtiyacKrediManager
            };                                                                                                    // süslü parantezlerin içi: müşterinin bilgi almak istediği kredilerden seçtiğini varsayalım.
            //- creditApplicationManager.GiveCreditPreInformation(krediler); // krediönbilgilendirmesiyap(kredilerden) demek.

            // yeni kredi oluşturmamız istendi diyelim, esnaf kredisi gibi. SOLID'in O harfi (sisteme yeni özellik eklendiğinde sistem bozulmaz)
            // yeni class'ı ekleriz hesapla kısmını simüle ederiz.
            // Başvuru kodunun (yukarda) ilk parametresini new EsnafKredisiManager() yaparız. ( ya da orada new'lemek yerine diğerleri gibi üzerinde instence yaparız.)

            // ayın şey loglama için de geçerli. artık sms de yollayalım dedik. smsLoggerService class'ı oluşturduk.
            // :ILoggerService ekleyip implement edip public void Log() { cw( "sms yollandı" ) } deriz.
            // Program cs kısmında başvuru ikinci parametresini new smsLoggerService() yapar ya da diğerleri gibi üstte new'leriz. (alternatif yollardır)

            // Bu yaptıklarımız Polimorfizmdir.
        }
Beispiel #27
0
        static void Main(string[] args)
        {
            // Inheritance ile beraber konuşmamız gereken konulardan biri de Interface'lerdir.

            // Yine bir bankacılık sistemi ve belirli operasyonları konuşalım.


            // 1. Aşağıda ilk olarak nesneler üreteceğiz ve bu nesnelerden metodları çağıracağız.
            PersonalFinanceCreditManager personalFinanceCreditManager = new PersonalFinanceCreditManager();

            personalFinanceCreditManager.Calculate();

            TransportCreditManager transportCreditManager = new TransportCreditManager();

            transportCreditManager.Calculate();

            MorgageCreditManager morgageCreditManager = new MorgageCreditManager();

            morgageCreditManager.Calculate();
            // Yukarıda zaten bir problem yok doğru şekilde sonuç döner.
            // Ama olay aşağıdaki gibi de çalışabiliyor olması.
            ICreditManager personalFinanceCreditManager1 = new PersonalFinanceCreditManager();

            personalFinanceCreditManager1.Calculate();

            ICreditManager transportCreditManager1 = new TransportCreditManager();

            transportCreditManager1.Calculate();

            ICreditManager morgageCreditManager1 = new MorgageCreditManager();

            morgageCreditManager1.Calculate();
            // Demek interface'ler de o interface'yi implemente eden class'ın referans numarasını tutabiliyor.


            ///// 2. Nesneleri teker teker üretip sonrasında metodları teker teker çağırmak mantıklı değildir. Tek bir çatı altında (Manager)
            ///// nesnelerimizi parametre olarak gönderip ilgili metodları çağırırız.
            // Biz kredi hesaplama işlemini yukarıdaki gibi teker teker sınıflar üzerinden yapmayacağız. Bir Manager üzerinden yöneteceğiz.
            ICreditManager personalFinanceCreditManager2 = new PersonalFinanceCreditManager();
            ICreditManager transportCreditManager2       = new TransportCreditManager();
            ICreditManager morgageCreditManager2         = new MorgageCreditManager();
            // Her bir kredi türünden referans oluşturduk.
            // Örneğin banka çalışanının ekranında kredi türünü seçmesi ve seçimden sonra kredinin hesaplanması.
            ApplicationManager applicationManager = new ApplicationManager();

            // Çalışan ihtiyaç kredisini seçti
            applicationManager.MakeAnApplication(personalFinanceCreditManager2);
            // Çalışan taşıt kredisini seçti
            applicationManager.MakeAnApplication(transportCreditManager2);
            // Çalışan konut kredisini seçti
            applicationManager.MakeAnApplication(morgageCreditManager2);

            Console.WriteLine("---------------------------------------");
            List <ICreditManager> credits = new List <ICreditManager>()
            {
                morgageCreditManager2, personalFinanceCreditManager2
            };

            applicationManager.MakeCreditNotification(credits);


            ///// 3. Dependencies injection yaparak birden fazla soyut nesneyi parametre olarak göndeririz.
            /// Aşağıdaki kullanım da doğrudur fakat birden fazla loglama yapabileceğimiz senaryosundan yola çıkarak kodu düzenleriz.
            ILoggerService fileLoggerService = new FileLoggerService();

            applicationManager.MakeAnApplication(morgageCreditManager2, new DatabaseLoggerService()); // böyle de kullanabilirim
            applicationManager.MakeAnApplication(transportCreditManager2, fileLoggerService);         // böyle de


            applicationManager.MakeAnApplication(new ArtisanCreditManager(), new List <ILoggerService> {
                new SMSLoggerService(), new DatabaseLoggerService()
            });
            // Yukarıdaki gibi direk new'leyerek de gönderebilir. Aşağıdaki gibi instance da oluşturabiliriz.
            ICreditManager        artisanCreditManager  = new ArtisanCreditManager();
            ILoggerService        smsLoggerService      = new SMSLoggerService();
            ILoggerService        databaseLoggerService = new DatabaseLoggerService();
            List <ILoggerService> loggers = new List <ILoggerService> {
                smsLoggerService, databaseLoggerService
            };

            applicationManager.MakeAnApplication(artisanCreditManager, loggers);

            List <ILoggerService> loggers1 = new List <ILoggerService> {
                new DatabaseLoggerService(), new SMSLoggerService()
            };

            applicationManager.MakeAnApplication(artisanCreditManager, loggers);
        }