예제 #1
0
        static void Main(string[] args)
        {
            ILoanManager financeLoanManager   = new FinanceLoanManager();
            ILoanManager transportLoanManager = new TransportLoanManager();
            ILoanManager mortgageLoanManager  = new MortgageLoanManager();

            ILoggerService loggerService = new FileLoggerService();

            ApplicationManager applicationManager = new ApplicationManager();
            //applicationManager.BasvuruYap(mortgageLoanManager , new DatabaseLoggerService());
            //applicationManager.BasvuruYap(transportLoanManager, loggerService);
            //applicationManager.BasvuruYap(new ArtisanLoanManager(), new SmsLoggerService());

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

            applicationManager.BasvuruYap(new ArtisanLoanManager(), loggers);

            /*applicationManager.BasvuruYap(new ArtisanLoanManager(), new List<ILoggerService>()
             * {
             *  new DatabaseLoggerService(),
             *  new SmsLoggerService()
             * });*/

            List <ILoanManager> loans = new List <ILoanManager>()
            {
                financeLoanManager, transportLoanManager
            };

            //applicationManager.DoLoanPreviewInformation(loans);
        }
예제 #2
0
        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);
        }
예제 #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);
        }
예제 #4
0
        static void Main(string[] args)
        {
            ICreditManager financeLoanManager   = new FinanceLoanManager();
            ICreditManager transportLoanManager = new TransportLoanManager();
            ICreditManager mortgageLoanManager  = new MortgageLoanManager();
            ICreditManager artisanLoanManager   = new ArtisanLoanManager();

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

            ApplicationManager applicationManager = new ApplicationManager();

            applicationManager.Apply(artisanLoanManager, new List <ILoggerService> {
                new DataBaseLoggerService(), new SmsLoggerService()
            });                                                                                                                             // new DataBaseLoggerService alternatif olarak böyle de ifade edilebilir

            List <ICreditManager> credits = new List <ICreditManager> {
                financeLoanManager, transportLoanManager
            };

            //applicationManager.CreditPreInformation(credits);
        }
예제 #5
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);
        }