CoursesAI WorkshopCompaniesPricingBlogConfAiBotSign inSubscribe
  • Courses
  • AI Workshop
  • Companies
  • Pricing
  • Blog
  • ConfAiBot
Subscribe
  • Courses
  • Companies
  • Communities
  • Blog
  • Gift card
  • Help
  • Shop
  • ConfAiBot
  • Contact
  • Legal notice
  • General conditions
  • Privacy policy
  • Cookies policy

SOLID - Single Responsibility Principle SRP and Interface Segregation Principle ISP

3 September 2015 | screencasts

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

  • Don't Create Objects That End With -ER: Article theorizing on why not to create classes like "Manager", "Processor", etc.
  • Extract Class Refactoring: Extract Class refactoring process.
  • Parallel Change Refactoring: Explanation of what it is and how to carry out the Parallel Change refactoring technique.
  • SOLID: Part 1 - The Single Responsibility Principle: Series of Tuts+ tutorials on SOLID.
  • Domain-Driven Design: Code Structure and Application Services: Video on Application Services and layer separation.

Upcoming videos

  • SOLID - Dependency Inversion Principle (Intermediate)
  • Interview!
  • DTOs / Anemic Domain Models vs Domain Models (Intermediate)
  • Composition over Inheritance - A turning point (Intermediate)

Tags

IntermediatePHPRefactoringSOLID
AnteriorSOLID - Dependency Inversion Principle
SiguientePHP - Code Style, PSR 2 Standard

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
  • Receive job offers verified by Codely
  • Company invoice

premium

41,58 €
Save 89 €
Annual payment of 499 €
per month
  • All previous benefits
  • Early access to new courses
  • Discount on workshops

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