That looks like the inner bean has a name. Did you mean:
<bean class="project.service.CompanyManager" />
Just curious since I've never worked with inner beans like this and I
don't use AOP much. After this thread, I might use it a lot more. I
hadn't thought of using it as a default even when I don't actually
have any advice to wire in...
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
That's nice... but means the CompanyManagerTarget can't be reused
across other Proxies ?
--
Tom
cheers,
barneyb
--
I just meant that- suppose I have a proxied EmailManager, but also
want to reuse that in a UserManger. I'd have to break out the
EmailManager from the 'internal' bean into a broper bean with an id.
So I'd be tempted to just use 'proper' beans all the time, as it's
less to change if dependencies alter.
--
Tom
<bean id="usermanager" class="usermanager">
<property name="emailmanager"><ref id="emailmanager" /></property>
</bean>
<bean id="emailmanager" class="emailmanager">
</bean>
With the AOP, it doesn't change except for the wrapping:
<bean id="usermanager">
<property name="emailmanager"><ref id="emailmanager" /></property>
</bean>
<bean id="emailmanager" class="ProxyFactoryBean">
<property name="target">
<bean class="emailmanager" />
</property>
</bean>
The fact that emailmanager is proxied is irrelevant to everyone,
usermanager just uses it as-is, wrapped or not.
cheers,
barneyb
--