Пример #1
0
        //interfaces newlenemez.
        static void Main(string[] args)
        {
            IPersonManager customerManager = new CustomerManager();

            customerManager.Add();

            IPersonManager employeeManager = new EmployeeManager();

            employeeManager.Add();

            ProjectManager projectManager = new ProjectManager();

            projectManager.Add(new InternManager());
        }
Пример #2
0
        static void Main(string[] args)
        {
            //Interface'ler new'lenemez
            IPersonManager customerManager = new CustomerManager();

            customerManager.Add();

            IPersonManager employeeManager = new EmployeeManager();

            employeeManager.Add();

            ProjectManager projectManager = new ProjectManager();

            projectManager.Add(employeeManager);
            projectManager.Add(customerManager);
            projectManager.Add(new InternManager());
        }
Пример #3
0
        //interface new'lenemez !!!
        static void Main(string[] args)
        {
            //interface ikisini de içerdiği için bu şekilde miras alabiliyorum.
            IPersonManager customerManager = new CustomerManager();

            customerManager.Add();

            IPersonManager employeeManager = new EmployeeManager();

            employeeManager.Add();

            ProjectManager projectManager = new ProjectManager();

            projectManager.Add(customerManager); //interface sayesinde istediğim tipte class gönderebileceğim
            projectManager.Add(employeeManager);
            projectManager.Add(new InternManager());
            //en son eklediğim yeni stajyer sınıfını, hiçbir koduma kodunmadan hızlıca algoritmaya dahil edebildim.
        }
Пример #4
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager();

            customerManager.Add();
            customerManager.Update();

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

            EmployeeManager employeeManager = new EmployeeManager();

            employeeManager.Add();
            employeeManager.Update();

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

            ProjectManager projectManager = new ProjectManager();

            projectManager.Add(customerManager);
        }