Byte Buddy for real-time systems #1385
Replies: 6 comments
-
Yes, you would likely want to use |
Beta Was this translation helpful? Give feedback.
-
Like here: https://gist.github.com/raphw/34c0e2fffe2ee7b4f02f ? |
Beta Was this translation helpful? Give feedback.
-
That's an example of the API, yes. |
Beta Was this translation helpful? Give feedback.
-
Hi Raphael. I am just wondering why there is no good library for code modification before compilation. lombok can add only methods, but I didn't find how to make a syntactic sub-class using this. Alex |
Beta Was this translation helpful? Give feedback.
-
There is JavaPoet which I personally like, but source code is way less structured what makes it much harder. Also, class file manipulation is more universal as it can target all JVM languages. |
Beta Was this translation helpful? Give feedback.
-
But JavaPoet doesn't allow to modify existing classes. |
Beta Was this translation helpful? Give feedback.
-
Hi.
We have very special case which exists only in real-time bidding and self-driving.
We have real-time Java agent which has 500+ input parameters from data sources and should answer within 300ms. To debug we need a sample of that input parameters and a outside environment reaction which very hard to simulate.
So we need to run our engine twice for debug:
Can we use Byte Buddy for the second purpose?
I checked https://www.baeldung.com/lombok-custom-annotation to duplicate all the classes to cover both points in real time, but Java code generation looks really as a headache comparing to byte code updates.
Regards,
Oleksii
Beta Was this translation helpful? Give feedback.
All reactions