We're loving the annotation based configuration but have a few queries relating to behavior and best practices.
* Is it a good idea to use a explicit ‘name’ on all annotations, or is this just wasted energy? i.e. depend on automatic type matching, or does this get you into deep trouble on large projects? I'm very interested in peoples experience with this, particularly since we have a 'large' project we want to slowly convert to remove the megabytes of xml files we have currently
* Is ‘@Transactional(readOnly = true)’ more trouble than it’s worth? Since it doesn’t throw exception for the common case (only for modification of sets), it seems like it would often lead non-inutive situations with weird bugs, i.e. expecting a method to write but no write happening.
* Is it a problem to apply for example the @Service annotation on a class and then to define the bean in XML? We want to use annotation configuration for everything but have a few beans that require settings to be set on them using a property placeholder.
* Setter or instance variable for @Resource annotation? Is there any difference, or should one be preferred over the other?
* Is @Required implicit in for @Resource annotation? As in, its not need, seems logical but would like it confirmed.
* Finally, why do people insist on doing this?
Doesn’t this just create a proxy, and then add a proxy to go around that?Code:@Aspect public class BusinessProfiler { @Pointcut("execution(* com.example.spring.aop.*.*(..))") public void businessMethods() { } @Around("businessMethods()") public Object profile(ProceedingJoinPoint pjp) throws Throwable { …



Reply With Quote
