0

I can understand how @target expression works, but I wonder why applying @target has to be determined after loading Spring applications (after all beans are created).

In my thought, right after objects to be registered as a bean are created, when the Spring BeanPostProcessor is executed, it seems to be possible to check which annotations are attached to the object class and the classes in inheritance relationship (parents and children).

Therefore, I wonder why Spring tries to create proxies for all beans when using AspectJ Expression, when only @target conditions are given and no other conditions are specified.

There seems to be a point where I am missing something, please point it out. Thank you and have a nice day.

kriegaex
  • 63,017
  • 15
  • 111
  • 202
davin111
  • 56
  • 5
  • In addition to my [answer](https://stackoverflow.com/a/53452483/1082681) in the question I marked this one as a duplicate of, please also see my related answers [here](https://stackoverflow.com/a/65210265/1082681) and [here](https://stackoverflow.com/a/71276086/1082681). – kriegaex Jan 16 '23 at 15:24

0 Answers0