1. simply recognize notes
- java in comments posted on the class like a label on the property or on the label and the text is to use annotation properties of the annotation defined. Property defines the required annotations added after the name () to do so because the property can be from another class, obtaining the target annotation, that calls the method to get the value of the annotation tag;
- Case 1:
imitate achieve a DAO and a class Service class:
two test methods, notes on a class test, a test annotation on the property:
the property-related note:
2. imitate beanFactory realization of spring
- Case 2: Log in case
problems that may arise, can not initialize Component annotation when to inject property value Autowired because of the following problems occur
3. spring in the bean implementation labels
Corresponding xml file: