- 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.
- Practical DevOps
- 網頁設計與制作教程(HTML+CSS+JavaScript)(第2版)
- Mastering LibGDX Game Development
- Data Analysis with Stata
- 軟件工程
- Visual C#通用范例開發金典
- FPGA Verilog開發實戰指南:基于Intel Cyclone IV(進階篇)
- SQL Server與JSP動態網站開發
- Learning Unreal Engine Android Game Development
- ArcGIS for Desktop Cookbook
- JavaScript動態網頁編程
- Python程序設計開發寶典
- UI動效設計從入門到精通
- Java EE項目應用開發
- Scratch編程從入門到精通