Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб Service Locator - Pt.2 - DI anti-pattern в хорошем качестве

Service Locator - Pt.2 - DI anti-pattern 2 года назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



Service Locator - Pt.2 - DI anti-pattern

Part 1 covered the other we can move away from Control Freak DI anti-pattern by introducing some sort of a factory (static/abstract/concrete). This part would cover use of DI containers and primarily use of Swinject framework. Although I'm using a framework as an example, you can easily come up with your own container. DI containers used outside of Composition Root are considered as service locators since they allow access to unrestricted number of volatile dependencies (dependencies that can fail and produce non-deterministic result). Service Locator is by far the most harmful anti-pattern among all since it complicates testing, makes dependencies implicit and makes reusing hard. Examples truly demonstrate why we should avoid it at all costs since there are better patter to solve the existing problem. Should you have any questions, leave a comment and I will explain more in detail. Credits to @Essential Developer for helping me learn all of those concepts in detail. If you are curios into learning from the original author, read the book "Dependency Injection, Patterns, Principles and Practices by Steven van Deursen, Mark Seemann". You can also find me on ↴ LinkedIn ☛   / babaev-islom   Medium ☛   / islom-babaev   Feel free to send your inquiries to ↴ Email ☛ [email protected]

Comments