简单描述下IOC(inversion of control)的理解
一个类需要用到某个接口的方法,我们需要将类A和接口B的实现关联起来,最简单的方法是类A中创建一个对于接口B的实现C的实例,但这种方法显然两者的依赖(Dependency)太大了。而IoC的方法是只在类A中定义好用于关联接口B的实现的方法,将类A,接口B和接口B的实现C放入IoC的 容器(Container)中,通过一定的配置由容器(Container)来实现类A与接口B的实现C的关联。
举一反三
- 描述什么是Spring IOC
- 以下说法错误的是() IoC思想是借助于“第三方”IoC容器,实现具有依赖关系的对象之间的解耦 IoC(Inversion of Control控制反转)是面向对象编程中的一种设计原则,可以用来减低计算机代码之间的耦合度 Spring为我们提供了两种核心容器,分别是BeanFactory和ApplicationContext,其中ApplicationContext是BeanFactory的子接口,在大多数企业级应用中,首选ApplicationContext 通常在Java项目中,会采用通过FileSystemXmlApplicationContext类来实例化ApplicationContext容器的方式
- 下列关于Spring特性中IoC描述正确的是()
- The<br/>effective inversion charge mobility is dependent of the electric<br/>field at the inversion layer and temperature.( )
- The term inversion does not show the direction of the movement, so sometimes Subject-Aux inversion is also termed as Auxiliary raising.
内容
- 0
依赖注入(DI)与控制反转(IoC)的含义不同,描述的不是同一个概念()
- 1
什么是Spring MVC ?简单介绍下你对springMVC的理解?
- 2
关于Spring的IoC说法正确的是()。 A: ioc容器通过读取配置文件进行装配 B: Ioc把工厂方法和对象生成这两者合并在一起 C: Ioc的目的就是提高程序的灵活性和可维护性 D: Ioc中最基本的Java技术就是”反射”编程
- 3
A temperature inversion occurs when______.
- 4
The depletion layer charge is ( ) the inversion region charge in the inversion state MOSFET. A: more than B: as same as C: less than