SOLID design principles for better team performance
A short overview of SOLID design principles with a practical example of how using them can improve team performance and reduce time needed to extend and maintain software.
@ktrajchevska SOLID design principles ー Write code that’s easy to maintain. ー Easily extend the software with new functionality without breaking existing ones. ー Spend less time reading and more time writing code.
App\Http\Controllers\CandidateController.php Controller knows too much and is open for modification. Methods depend directly on the CRM storage and their naming conventions.
@ktrajchevska What does it take to change the storage? 1. Add Eloquent models to use with MySQL. 2. Change controller dependencies from CRM class to Eloquent. 3. Use Eloquent instead of CRM to pull data for the view. 4. Switch all variables to the new naming convention. 5. Change the way we access data in the views. 6. Adjust the unit tests to work accordingly.
@ktrajchevska What does it take to switch the storage? 1. Add Eloquent models to use with MySQL. 2. Create MysqlCandidateRepository that implements CandidateRepositoryInterface. 3. Change the binding for CandidateRepositoryInterface.
@ktrajchevska Better team performance with SOLID ー Spending less time reading code. ー Reducing time needed to extend the software. ー Reducing bugs by closing the core of the system. ー Improving productivity and reducing costs.