Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ Tháng 6, 2017

S.O.L.I.D Principles

These principles, when combined together, make it easy for a programmer to develop software that are easy to maintain and extend. They also make it easy for developers to avoid code smells, easily refactor code, and are also a part of the agile or adaptive software development. Single Responsibility Principle One class should have one and only one responsibility. Write, maintain and change for one purpose. Flexibility to make changes in the future without worrying the impacts of changes for another entity. Example: However, the logic of determining whether the employee is promoted due this year is actually not a responsibility which the employee own. Generate employee report is not responsibility of the Employee. → Employee class should have the single responsibility of maintaining core attributes of an employee   so we should write one different class for report generation , so that any change in report generation should not affect the ‘ Employee ’ cla...