A Guide to Monkey-Patching in Javaby@nfrankel
271 reads

A Guide to Monkey-Patching in Java

by Nicolas Fränkel14mSeptember 21st, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The article discusses various approaches to implementing monkey-patching in Java. It begins with an explanation of monkey-patching and introduces the Decorator Design Pattern as a method to achieve similar functionality. The article then explores Java Proxy as a generic decorator and demonstrates its use. Instrumentation in Java is explained as a means to transform bytecode before loading it through a Java agent. Aspect-Oriented Programming (AOP) with AspectJ is also covered as a way to apply aspects across different object hierarchies.

People Mentioned

Mention Thumbnail
featured image - A Guide to Monkey-Patching in Java
Nicolas Fränkel HackerNoon profile picture
Nicolas Fränkel

Nicolas Fränkel

@nfrankel

Developer Advocate for Apache APISIX *** Learner *** Author of http://leanpub.com/integrationtest

About @nfrankel
LEARN MORE ABOUT @NFRANKEL'S
EXPERTISE AND PLACE ON THE INTERNET.

STORY’S CREDIBILITY

Guide

Guide

Walkthroughs, tutorials, guides, and tips. This story will teach you how to do something new or how to do something better.

Share Your Thoughts

About Author

Nicolas Fränkel HackerNoon profile picture
Nicolas Fränkel@nfrankel
Developer Advocate for Apache APISIX *** Learner *** Author of http://leanpub.com/integrationtest

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
L O A D I N G
. . . comments & more!