Skip to content

Instantly share code, notes, and snippets.

View yuuow's full-sized avatar
focusing

Ryuko yuuow

focusing
View GitHub Profile

JDK Dynamic proxy can only proxy by interface (so your target class needs to implement an interface, which is then also implemented by the proxy class).

CGLIB (and javassist) can create a proxy by subclassing. In this scenario the proxy becomes a subclass of the target class. No need for interfaces.

So Java Dynamic proxies can proxy: public class HelloImpl implements Hello where CGLIB can proxy: public class HelloImpl

ref: https://stackoverflow.com/questions/10664182/what-is-the-difference-between-jdk-dynamic-proxy-and-cglib

@yuuow
yuuow / 📊 Weekly development breakdown
Last active September 28, 2020 00:56
📊 Weekly development breakdown
YAML 41 mins ████████▋░░░░░░░░░░░░ 41.3%
Java 40 mins ████████▍░░░░░░░░░░░░ 40.4%
XML 7 mins █▌░░░░░░░░░░░░░░░░░░░ 7.5%
Other 4 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.2%
Git Config 3 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.5%