Talk in English - UK at Mage Titans Italy 2017
View Slides: http://slides.yireo.com/yireo/messing_up_di
Short URL: https://joind.in/talk/c5aa2 (QR-Code (opens in new window))
Through training and consultancy, I’ve been dealing with Magento 2 projects, without actually having a single responsibility in them. However, while standing on the sideline, I’ve seen many examples of Magento 2 development gone wrong. For the major part, this deals with Dependency Injection – one of the fundamental principles of Magento 2 architecture. DI is meant to clean up the code, allowing for looser dependencies. However, when applied wrongly, the code can still become spaghetti code – I know Italians love pasta, but you can’t find the beginning and the end of the code, it means the code should be improved. Even worse, one attempt of the Magento core team to enforce better DI upon developers with the coming of Magento 2.1, was perceived by many third-party developers as an instability of Magento 2, which I think was wrong. My talk will, therefore, be about the proper ways to apply Dependency Injection in Magento 2. It will point out mistakes, to then give you the handles to improve your code.
Comments are closed.
Nice talk on the do's and don'ts of DI in Magento2
One of my favourite talks of the day. Very well presented and cleverly delivered.
Not only were there some great advanced level tips provided, such as not using helpers, checking $context, composition over inheritance and object manager usage, but clear reasoning for why was given. Showing the 'wrong' way then the 'right' way was also a great touch.