This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
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.