SOLID - Single Responsibility Principle SRP and Interface Segregation Principle ISP

In this video, we will see what SOLID principles are. As usual, we will approach it in a 100% practical way. Applying a refactoring on existing code to avoid violating the Single Responsibility Principle (or SRP). We will also see how this is related to the Interface Segregation Principle (or ISP). In previous videos, we already saw how to set up our PSR-4 namespaces structure and start using Composer's autoloader and how to apply the PSR-2 coding style standard. Now it's time to roll up our sleeves and dive into deeper topics like SOLID principles.

Video Index

  • 0:29 - What are SOLID principles
  • 1:28 - Context: What the code to be refactored does
  • 5:12 - Violation of the Single Responsibility Principle - SRP
  • 7:07 - Issues when violating SRP
  • 9:57 - Refactoring the registerNewUser method
    code of the RegisterNewUserUseCase class
    Refactoring respecting the SOLID Principle of Single Responsibility
  • 17:41 - Violation of the Interface Segregation Principle - ISP
    code of a DatabaseRepository interface with the methods getUser and insertUser
    Violation of the SOLID principle of Interface Segregation

Video

Related material

Upcoming videos

Pay according to your needs

lite (only monthly)

19 €
per month
  • Access to a subset of courses to lay the foundation for maintainable, scalable, and testable code
  • Company invoice
Popular

standard

24,92 €
Save 121
Annual payment of 299
per month
  • Full course catalog
  • Design and architecture challenges
  • Highlighted solutions videos for challenges
  • Receive job offers verified by Codely
  • Company invoice

premium

41,58 €
Save 89
Annual payment of 499
per month
  • Everything above
  • More benefits coming soon

We won’t increase the price while your subscription is active