From the course: Spring: Framework in Depth

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Proxies

Proxies

From the course: Spring: Framework in Depth

Start my 1-month free trial

Proxies

- [Instructor] The final topic in this chapter that we need to discuss is proxies. Proxies are essentially aspected behavior that is applied to your classes by the framework under various conditions. In Spring, everything is a proxy. And this comes with some considerations. This behavior was added in Spring 4.0. All of your classes, regardless of their annotations, get wrapped with at least one proxy. Proxies are used to add behavior to your class. Many of the proxies have specific purposes that enable you to write code cleaner, things like transactional boundaries. Spring uses both JDK and CGLib-based proxies in its operation. I mentioned a moment ago that there are some considerations when using proxies. First and foremost, and one that will cause a defect at least once if you don't remember this, is that proxies can only apply their behavior when a call goes through to proxy. Private methods don't get exposed via the proxy…

Contents