Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SOLID design principles for better team performance

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.

Katerina Trajchevska

November 10, 2019
Tweet

More Decks by Katerina Trajchevska

Other Decks in Programming

Transcript

  1. @ktrajchevska Katerina Trajchevska • Co-founder of Adeva, an exclusive developers’

    network. • Software Engineer & Mozilla Tech Speaker • Consultant with startups and Fortune 500 @ktrajchevska
  2. @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.
  3. @ktrajchevska A class should be open for extension, but closed

    for modification. Open/Closed Principle
  4. 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.
  5. @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.
  6. @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.
  7. @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.