Let’s talk about single-responsibility principle. We’ll create Employee class, that has name, duty, ID. Also we will add methods for getting employee list and employee with some ID.

    public class Employee
    {
        public string Name { get; set; }
        public string Duty { get; set; }
        public string Id { get; set; }

        public static IEnumerable<Employee> GetAllEmployees()
        {
            throw new NotImplementedException();
        }

        public static Employee GetEmployeeById(string id)
        {
            throw new NotImplementedException();
        }
    }

We received violation of single-responsobility principle. Employee class shouldn’t have to return employee list.

How we can change this situation? Employee class should have all this properties. But we should create new class EmployeeCatalog Class that will connect to database and return employee list. Let’s see for new classes.

    public class Employee
    {
        public string Name { get; set; }
        public string Duty { get; set; }
        public string Id { get; set; }
    }
    public class EmployeeCatalog
    {
        public static IEnumerable<Employee> GetAllEmployees()
        {
            throw new NotImplementedException();
        }

        public static Employee GetEmployeeById(string id)
        {
            throw new NotImplementedException();
        }
    }

Therefore, we received 2 classes, 2 areas of responsibility.

What’s the main goal of this transformations? When your application or your project is not so big, you haven’t any problems. But when you’ll decide to add properties, methods to both classes, you receive better scaling of your product and more transparent testing.