小马哥课程笔记
IoC 容器的职责
维基百科(https://en.wikipedia.org/wiki/Inversion_of_control) 在 Overview 小节中提到:
“Inversion of control serves the following design purposes:
- To decouple the execution of a task from implementation.
- To focus a module on the task it is designed for.
- To free modules from assumptions about how other systems do what they do and instead rely on contracts.
- To prevent side effects when replacing a module.
Inversion of control is sometimes facetiously referred to as the “Hollywood Principle: Don’t call us, we’ll call you”.”
IoC 容器的职责
IoC 容器
-
主要实现
- Java SE
- Java Beans
- Java ServiceLoader SPI
- JNDI(Java Naming and Directory Interface)
- Java EE
- EJB(Enterprise Java Beans)
- Servlet
- 开源
- Apache Avalon(http://avalon.apache.org/closed.html)
- PicoContainer(http://picocontainer.com/)
- Google Guice(https://github.com/google/guice)
- Spring Framework(https://spring.io/projects/spring-framework)
本文是小马哥课程笔记,介绍了 IoC 容器的职责,包括解耦任务执行与实现、聚焦模块功能等。还阐述了其通用职责如依赖处理、生命周期管理等,以及主要实现,涵盖 Java SE、Java EE 相关技术和一些开源框架,如 Spring Framework 等。


被折叠的 条评论
为什么被折叠?



