Sto cercando di capire @Autowired in Spring Boot.
Sto leggendo qui:
https://www.lucazanini.eu/it/2012/java/autowired-and-resource-in-spring/
In particolare mi sono soffermato su questo esempio:
package eu.lucazanini.autowired;
import org.springframework.beans.factory.annotation.Autowired;
public class SimpleBean {
private String name;
private SimpleProperty property;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public SimpleProperty getProperty() {
return property;
}
@Autowired
public void setProperty(SimpleProperty property) {
this.property = property;
}
}
package eu.lucazanini.autowired;
import org.springframework.beans.factory.annotation.Autowired;
public class SimpleProperty {
private String name;
public String getName() {
return name;
}
@Autowired
public void setName(String name) {
this.name = name;
}
}
Il setName() inizializza il campo name di SimpleProperty e SimpleBean?
ciao