- Drupal 8 Module Development
- Daniel Sipos
- 149字
- 2021-07-02 15:45:09
Services and the dependency injection container
Another architecturally important element of Drupal 8 is the Symfony dependency injection component (http://symfony.com/doc/current/components/dependency_injection.html), concretely represented by the service container.
This component is a staple of modern OOP PHP programming and as such has become foundational to Drupal 8. It allows us to create services that can be injected in various places (and receive themselves services as dependencies). They are then used for the heavy business logic of our functionality. Additionally, they are at times also used as an extension point because the service container is able to collect certain services that are marked as serving a specific purpose and use them automatically. In other words, simply by defining a simple service, we can provide our own functionality or even change the existing logic.
We will encounter many services, and we will see how we can declare our own later in this book.
- DBA攻堅指南:左手Oracle,右手MySQL
- 測試驅(qū)動開發(fā):入門、實戰(zhàn)與進(jìn)階
- Python爬蟲開發(fā):從入門到實戰(zhàn)(微課版)
- Selenium Design Patterns and Best Practices
- Building a Quadcopter with Arduino
- The DevOps 2.5 Toolkit
- Visual FoxPro程序設(shè)計習(xí)題集及實驗指導(dǎo)(第四版)
- GameMaker Essentials
- OpenCV with Python Blueprints
- 小程序從0到1:微信全棧工程師一本通
- .NET 4.0面向?qū)ο缶幊搪劊簯?yīng)用篇
- ASP.NET開發(fā)寶典
- Kohana 3.0 Beginner's Guide
- Learning Perforce SCM
- 情境微課開發(fā)(第2版)