I am looking into a codebase where every POJO has been managed by spring and injected using lookup annotation
.
@Lookup
public Publisher getPublisher() {
return new Publisher();
}
@Lookup
public Book getBook() {
return new Book();
}
These Publisher and Book objects are nothing but POJO with just getter/setters. These classes are spring managed as prototype beans. I am thinking, it is over use of lookup annotation and overhead where we could just use factory methods or simply create new instance. Do you think using lookup annotation for this use case useful/efficient?