Joke Collection Website - Talk about mood - How to understand the spring ioc container
How to understand the spring ioc container
IOC—-control inversion, that is, "control inversion", is not a technology, but a design idea. In Java development, Ioc means giving the object you designed to container control, rather than the traditional direct control object. How to understand the International Olympic Committee? In order to understand the IOC well, the key is to find out "who controls who, what, why it is inversion (it should be positive inversion) and what aspects of inversion". Then let's analyze it in depth:
● Who controls who and what: In traditional Java SE programming, we directly create objects inside the objects through new, which is the initiative of the program to create dependent objects; Ioc has a special container to create these objects, that is, IoC container controls the creation of objects; Who controls who? Of course, the IoC container controls the object; Control what? That is, it mainly controls the acquisition of external resources (not only objects including files, etc.). ).
● Why is it reversed? What aspects are upside down? Where there is a reversal, there is a forward rotation. The traditional application directly obtains the dependent object by its own control in the object, that is, forward rotation; Inversion is to create and inject dependent objects with the help of containers; Why is it backwards? Because the container helps us find and inject the dependent object, the object only passively accepts the dependent object, so it is inverted; What aspects have been reversed? The acquisition of related objects has been reversed.
- Previous article:What did the wedding team say?
- Next article:Tell me what your parents said that hurt you.
- Related articles
- What are the most attractive copywriting on Douyin? Can it be interactive?
- Another graduation season. What are some good poems suitable for saying goodbye to friends?
- Tell me what it's like to be in a love triangle.
- Who is the woman writer who occupies an important position in the history of literature?
- Talk about your mood, expression, funny sentences describing your cold, and talk about your mood.
- Talk about warm-hearted love words suitable for the object.
- Color matching of square scarf and tie
- Family conflicts make people sad and desperate to collapse.
- Talking about the space of hats
- Rainy day sad talk about mood phrases rainy day talk about sadness and beauty talk about.