Example #1
0
        static void Main(string[] args)
        {
            // PersonalFinanceLoanManager personalFinanceLoanManager = new PersonalFinanceLoanManager();
            // TransportLoanManager transportLoanManager = new TransportLoanManager();
            // MortgageLoanManager mortgageLoanManager = new MortgageLoanManager();
            ILoanManager personalFinanceLoanManager = new PersonalFinanceLoanManager();
            ILoanManager transportLoanManager       = new PersonalFinanceLoanManager();
            ILoanManager mortgageLoanManager        = new PersonalFinanceLoanManager();

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

            ApplicationManager applicationManager = new ApplicationManager();

            // applicationManager.Apply(mortgageLoanManager, new DatabaseLoggerService()); // Bu sekilde de yapabiliriz.
            applicationManager.Apply(mortgageLoanManager, databaseLoggerService);

            // Asagida istenen kredi tipinin manager'i yollanabilir. Soyutlama bu sekilde saglanmis oluyor.
            // Interface'lerin kullanimi c*k onemli. O interface'i kullanarak olusturulan siniflarin 'heap memory'deki
            // referansini tutabiliyor.
            // applicationManager.Apply(mortgageLoanManager);
            // applicationManager.Apply(transportLoanManager);
            // applicationManager.Apply(mortgageLoanManager);

            List <ILoanManager> krediler = new List <ILoanManager> {
                personalFinanceLoanManager
            };

            // applicationManager.KrediOnBilgilendirmesiYap(krediler);
        }
Example #2
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);
        }
Example #3
0
        //SOLID
        //O- Open Closed Principle
        //Sisteme yeni bir özellik eklendiğinde mevcut kodlar bozulmaz.
        static void Main(string[] args)
        {
            //Interfaceler de o interfacei implemente eden class ın referans numarasını tutabilir.
            ICreditManager personalFinanceLoanManager = new PersonalFinanceLoanManager();
            ICreditManager transportLoanManager       = new TransportLoanManager();
            ICreditManager mortgageLoanManager        = new MortgageLoanManager();

            ApplicationManager appManager = new ApplicationManager();

            appManager.MakeAnApplication(personalFinanceLoanManager, new DatabaseLoggerService());
            appManager.MakeAnApplication(mortgageLoanManager, new FileLoggerService());


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

            //.MakeAnCreditPreinformation(credits);
        }
Example #4
0
        static void Main(string[] args)
        {
            ILoanBaseManager personalFinanceLoanManager = new PersonalFinanceLoanManager();
            ILoanBaseManager transportLoanManager       = new TransportLoanManager();
            ILoanBaseManager mortgageLoanManager        = new MortgageLoanManager();

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

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.MakeApplication(personalFinanceLoanManager, databaseLoggerService);
            applicationManager.MakeApplication(mortgageLoanManager, fileLoggerService);
            //applicationManager.MakeApplication(transportLoanManager);
            //applicationManager.MakeApplication(mortgageLoanManager);

            List <ILoanBaseManager> loans = new List <ILoanBaseManager>()
            {
                personalFinanceLoanManager, transportLoanManager, mortgageLoanManager
            };

            //applicationManager.LoanPreInformation(loans);
        }