Welcome to the new Spring.io forums!
If this is your first visit, be sure to check out the
by clicking the link above, and for security reasons, use the
forgot password link to reset your password..
You may have to register before you can post: click the register
link above to proceed. To start viewing messages, select the forum that you want to visit
from the selection below.
No announcement yet.
@Configurable couple tightly domain object with Spring?Page Title Module
@Configurable couple tightly domain object with Spring. Means that domain object can not relocate to other solutions. Is this a good practice?
Please let me know your thought.
Annotation is just one way for identifying the injection. The other choice is to write an AspectJ pointcut expression, which is as well offerred by Spring 2.0. If u do not like annotations, then u can very well use an abstract aspect to provide your own pointcut definitions. Spring 2.0 comes bundled with an aspect jar (from AspectJ), spring-aspects.jar, which provides a base class AbstractBeanConfigurerAspect. Using this, u you can write an aspect to configure all instances of objects defined in the domain model using prototypical bean definitions that match the fully-qualified class names. Please refer to Section 7.7.2 of the Spring Reference Documentation for an example. Find more of this here and the comments section of this blog entry.