The first one is the configuration of the internal bean:
The first is to understand the principle, and then to operate it is very simple, the following cousin to everyone to say their own point of view (a bit simple, but cousin I first study when watching the video on the code is really a little confused, record their own moment of the time).
In fact, you know the meaning of it is very simple, do not be fooled by the name (very advanced name, cousin on the popular understanding),
The so-called internal bean:
A person has name,age,car these three attributes, (people do not have to drive it?) The car is sure to open! )
Configure the XML file for person with car this configured property (Forexam Cannon: Wheel, Brand, price) at this time a <perporty ref= "/> refers to the past can be, of course, in the back of the configuration of a single also line with the constructor injection.
Called to reference an internal bean. Like inheritance, inherits the property values of the bean configuration of car. to be blunt, the bean of the person refers to the property bean of the property (car).
(The internal bean should be the person's property inside the car, followed by the bean configuration file of car, so called the internal bean, the bean that references the car is called the reference internal Bean).
The second is to assign a value to the cascading property:
Cascading properties is also a bluff name:
Cascading properties as the name implies is the thing between the property and the property, the constructor injected ref= "Car", the following can be assigned to the property of car, this understanding is more simple
person has a name age and a car, one day he suddenly wanted to sell the car, he gave the car a re-write a price how much money, so .
Assign a value to a cascading property: Assign the property of car to the person's profile. is to assign a value to the property's property in the configuration file .
Note, however, that a property needs to be initialized before it can be assigned a value for a cascading property, otherwise there will be an exception.
is a number of initialization methods (typically written in XML when the compiler will give hints).
(This figure is cut on the internet, if more offended please contact me immediately delete Thank you)
Spring references intrinsic bean properties and to cascading properties