- 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.
- C#編程入門指南(上下冊)
- C# 從入門到項目實踐(超值版)
- Rake Task Management Essentials
- Responsive Web Design with HTML5 and CSS3
- C語言程序設(shè)計
- Django 3.0入門與實踐
- Python入門很輕松(微課超值版)
- HTML5+CSS3+jQuery Mobile APP與移動網(wǎng)站設(shè)計從入門到精通
- Learning ECMAScript 6
- 軟件測試技術(shù)
- Leaflet.js Essentials
- PhantomJS Cookbook
- R語言數(shù)據(jù)分析從入門到實戰(zhàn)
- Learning Swift
- 秒懂算法:用常識解讀數(shù)據(jù)結(jié)構(gòu)與算法