IoC
It is
Inversion of Control
, control inversion. In
Java
In development,
IoC
means to turn the class of your design
Give the system control, not within your class. This is called control inversion.
Let's take a few examples to illustrate what is
IoC
Suppose we're going to design a
Girl
and a
Boy
Class
which
Girl
Yes
Kiss
Method
That
Girl
Want
Kiss
One
Boy
。
So, our problem is,
Girl
How to get to know this
Boy
?
In our China, the common mm and
Gg
There are several ways to recognize
1
Childhood
2
Friends and family introduction;
3
Parents arranged
So which one is the best?
Childhood:
Girl
I've known myself since I was a kid
Boy
。
public class Girl {
void Kiss () {
Boy boy = new Boy ();
}
}
However, it was created from the beginning
Boy
The disadvantage is that it cannot be replaced. and be responsible for
Boy
The entire life cycle. If I
them the
Girl
What do you want to change? (Seriously not supported
Girl
Frequent replacement
Boy, #_ #
)
http://user.qzone.qq.com/3184973455
http://user.qzone.qq.com/2289555839
http://user.qzone.qq.com/2413219376
http://user.qzone.qq.com/3134492214
http://user.qzone.qq.com/2338966447
http://user.qzone.qq.com/2833262360
http://user.qzone.qq.com/2309677917
http://user.qzone.qq.com/2712657476
http://user.qzone.qq.com/3131536774
http://user.qzone.qq.com/2849200790
http://user.qzone.qq.com/2377678239
http://user.qzone.qq.com/1261584337
http://user.qzone.qq.com/2839535490
http://user.qzone.qq.com/3085174574
http://user.qzone.qq.com/3095908434
http://user.qzone.qq.com/2980578685
http://user.qzone.qq.com/2334159896
http://user.qzone.qq.com/2812747595
What does iOS refer to?