Skip to main content

O: Open-Closed Principle - Vendor in Laravel

Premium
2:48

The Full Lesson is Only for Premium Members

Want to access all of our courses? (30 h 09 min)

You also get:

55 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Comments & Discussion

V
vpinti ✓ Link copied!

Hi Povilas, but the invoiceController class doesn't go against the first principle of Single Responsibility?

PK
Povilas Korop ✓ Link copied!

Hi Vittorio, you mean that it created a buyer, an item and an invoice? Yes, I agree, this was just an example to illustrate the open-closed principle, in real-life example I wouldn't create it all in one method.

AM
Alejandro Morales ✓ Link copied!

Amazing, I was just out of a round of interviews for Senior dev where I probably was in top 5 and did not get the job. One of the topics that I want to improve so it's not a diferentiator vs the other candidates is to properly explain SOLID Principles usage in Laravel. A quick answer could be, "the vendor packages are closed to modification because once they are updated you lose the changes, but open to extension if you need extra functionalities that the vendor does not provide"

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.