Home > Backend Development > PHP Tutorial > 如何理解 service locator 和 dependence inject

如何理解 service locator 和 dependence inject

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:13:44
Original
998 people have browsed it

暂时的理解是 (也不知道是不是这样):
di 就是用 反射实现的 ioc
service locator 就是结合了注册器模式和工厂模式(带记忆功能的工厂模式)

尽量用 PHP 的小例子说明, 感谢了

回复内容:

暂时的理解是 (也不知道是不是这样):
di 就是用 反射实现的 ioc
service locator 就是结合了注册器模式和工厂模式(带记忆功能的工厂模式)

尽量用 PHP 的小例子说明, 感谢了

https://github.com/domnikl/DesignPatternsPHP/tree/master/More

每天看一遍,直到恍然大悟。

学习设计模式是一个漫长的过程 《PHP设计模式》

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template