What is dependency injection in Magento 2?
0
Dependency injection is one of the most widely used design patterns in Magento 2. It allows developers to add a dependency to a calling framework or a module. In Magento and other programming languages, dependency injections are often explained as the Hollywood principle.
So, it would be great to hear the iconic Don't call us, we call you” from a candidate during a job interview.
As for the advantages, here are the main benefits of using Magento dependency injections:
Improves code reusability.
Makes code easier to test.
Promotes hassle-free app maintenance.
Sign in to add a comment
0 Answers
0
📝 No answers yet!
Be the first to answer this interview question.
Your Answer
Sign in to post your answer and help the community.