Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Ive noticed that objects imported by Spring DM are not always equal to the raw target service. Why is that?

0
Posted

Ive noticed that objects imported by Spring DM are not always equal to the raw target service. Why is that?

0

To deal with dynamics, Spring DM creates proxies around the imported services. The proxies are classes (generated at runtime), different from the target but able to intercept the calls made to it. Since a proxy is different then its target, comparing objects against it can yield different results then when the comparison is done against the target. In most scenarios this is not a problem but there might be corner cases where this contract matters. Since 1.1, Spring DM importer proxies implement InfrastructureProxy interface (from Spring framework) which allow access to the raw target.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123