Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

inner bean - aop proxy

I was reading folowing line and I did not understand clearly.
Inner beans
Another lesser used means of wiring bean references is to embed a <bean> element
directly in the <property> element. For example, the studentService property
of the courseService bean could be wired as follows:
<bean id="courseService"
class="com.springinaction.service.training.CourseServiceImpl">
<property name="studentService">
<bean
class="com.springinaction.service.training.StudentServiceImpl"/>
</property>
</bean>
The drawback of wiring a bean reference in this manner is that you cannott reuse the
instance of StudentServiceImpl anywhere else it is an instance created specifically
for use by the courseService bean. You may also find that using inner-bean
definitions impacts the readability of the XML. On the other hand, this could be
beneficial if we donot want an actual bean instance to be accessible without a wrapper
bean. For example, if we are creating an AOP proxy, we may not want the target
bean to be accessible in our BeanFactory. In this case, configuring the proxy’s
target using an inner bean would achieve this goal.

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

can you please elaborate on this.