Have you ever created or encountered a self modifying code in Java? If yes, then please post the link or simply post the code.
Ignoring the world of grief you could be causing yourself via self-modifying code(!), it seems to me there are 3 options:
Of the three above, my initial choice (in the absence of requirements) would be to take a look at option 3. I suspect it's the least painful way to start. I've used all of the above - unfortunately I can't post links to client code.
You can write (Java) code that generates new classes (byte code) at runtime using a library like bcel. That's not quite the same as self-modifying code. I suspect self-modifying code is not something the JVM supports.
For an example of generating new code at runtime, have a look at the source code of clojure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With