Reputation: 19208
In .Net, it seems you cannot
You have to decide between 2. (by generating the code into the calling AppDomain itself) or 3. (by generating the code into a throw-away AppDomain), but you cannot have both.
Now I'm curious if this is possible in Java. I don't know enough about ClassLoaders, but it seems in Java I could
Is that assumption valid?
Upvotes: 2
Views: 95
Reputation: 13238
Yes, you can compile / load a class a code away class loader, the call it without issue.
Yes, dynamically code will reach 'full performance'. There no difference. However, the newly loaded code will start in interpreted mode and needs to warm up before it is compiled.
However, point 3. is very tricky.
Upvotes: 2