# ProxyFactory and ProxyFactoryBean in Spring

DevFeed: [ProxyFactory and ProxyFactoryBean in Spring](<https://devfeed.tech/articles/proxyfactory-and-proxyfactorybean-in-spring-27308.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201906/proxy-factory/>)

Published: 2019-06-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Spring Framework](<https://devfeed.tech/topics/spring-framework.md>), [Java](<https://devfeed.tech/topics/java.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [framework](<https://devfeed.tech/tags/framework.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [java](<https://devfeed.tech/tags/java.md>), [proxy](<https://devfeed.tech/tags/proxy.md>), [spring](<https://devfeed.tech/tags/spring.md>)

## AI overview

This tutorial explains how Spring's ProxyFactory and ProxyFactoryBean create object proxies. It compares native Java proxies with CGLIB-based proxies and shows how Spring abstractions can create proxies for interfaces and concrete classes.

## Source excerpt

Spring provides many easy to use abstractions and you use many of them without even knowing about them. You probably know that in order to have @Transactional or @Cacheable annotation work spring creates proxies for you (sometimes proxies on top of proxies...), but have you ever wondered how it's happening under the hood? What Creation of object proxies is a cumbersome task. One has to decide if the proxy should be created using native java mechanisms (JdkProxy available only on interfaces) or using cglib and it's complicated interfaces. Read more