Basic concepts in Java Class, Object and the Spring Bean, BeanFactory of


Java language, objects (Object) is an instance of the class (Class) of. Bean, BeanFactory concept Spring is proposed.


A, the Java
the Java is an object-oriented language.
Class (Class)
class is highly simulation of the properties and behavior of the same kind of things. Class can be interpreted as: Category type.
In nature, feather flock together, such as birds, humans, automobiles, like flowers and so on. The same thing from a different dimension and can be divided into different types of years, such as birds and humans can be divided into animals, the same species can also continue to be divided into species with delicate, such as a human can be further divided into boys and girls.

The laws of nature is a process of increasing entropy, then find out the laws of nature by human intervention to reduce the entropy (or control entropy change), so as to allow the machine to complete the task of purposes. The categories of human things in the universe of human understanding, to understand the world, improve the means of subsistence. The advent of the computer is to make people from the heavy manual labor (AI possible future human from mental work) liberated in. In object-oriented programming language that allows an application to abstract, to simulate the actual problems entities - into classes, and then find an entity to assume in practice functions, responsibilities - what methods these classes should have, so the purpose of solving the problem.


Object (Object)
object is an instance of a class. Object (Object) is through the class (Class) to construct the model out of a real and true stuff. Since it is a program to simulate the real world, so in the program, with a human model to construct a specific person is completely inevitable. Therefore, a specific object is to accomplish this task objects in his life. You can construct hundreds of people in the program to accomplish one thing.

The JavaBean
the JavaBean written in JAVA language is a reusable component. It is written in the JavaBean, and specific class must be public, and with no argument constructor. JavaBean by providing a common method in line with the consistency of design patterns will expose internal domain member properties, set and get methods to obtain. As we all know, the attribute name in line with this model, and other Java classes can be found through the operation of these attributes JavaBean introspection mechanism (reflection).
- Excerpt from the Baidu Encyclopedia


Two, the Spring
1.Bean

Official documents ([https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/core.html#beans-definition](https://docs.spring.io/spring-framework /docs/current/spring-framework-reference/core.html#beans-definition)) in explanation:

In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. Otherwise, a bean is simply one of many objects in your application. Beans, and the dependencies among them, are reflected in the configuration metadata used by a container.


In Spring, constitute the backbone of the application by the Spring IoC container management objects (for Java language, which is in front of the article said Java object) called Bean. Bean is instantiated by the Spring IoC container, assembling and otherwise managed objects. Otherwise, Bean is just the application of a number of objects (IOC container to manage without it, the relationship between the life cycle Bean and Bean and Bean could not centralized management). Dependencies between Bean and Bean reflected in the configuration using the metadata container.

Bean and Java Object in fact essentially a stuff.

2.BeanFactory

documents are described:
 at The BeanFactory interface the Provides advanced AN Capable of Managing the Configuration mechanism of the any of the type Object ApplicationContext IS A Sub-interface of BeanFactory..
BeanFactory interface provides an advanced configuration mechanism capable of managing any type of object. ApplicationContext is a subinterface of BeanFactory.

org.springframework.beans.factory.BeanFactory` viewed from the code is an interface (Interface) Spring of.


BeanFactory manage any type of object. Specific analytical point is to read the definition of Bean gradually initialization Bean, Bean placed IOC container construction, destruction Bean. Bean BeanFactory manage the entire life cycle.

Guess you like

Origin www.cnblogs.com/abelzhan/p/12022064.html