"Dynamic linking allows types to be incrementally incorporated into a running JVM. Dynamic extension allows the decision as to which types are loaded into a JVM to be deferred until runtime. This means that an application hosted by the JVM can leverage types that were previously unknown, or perhaps did not even exist, when the application was compiled. Dynamic linking and extension support the notion of runtime assembly of code, a notion of critical importance to server-side containers (e.g. application servers)."
I was just wondering what has the author meant by -
'or perhaps did not even exist, when the application was compiled'??
It means that programs can use classes that didn't (necessarily) exist when the program was compiled: Java can instantiate arbitrary classes at runtime. So, for example, we might write a class that implements an interface. A program that uses that class can be written before that implementation existed.
(Via reflection we don't even need to have an interface implementation or subclass, but that's a different issue, and probably not what they were referring to.)
If you want a type at runtime yes, you'd need the type at runtime.
That seems obvious, though, so I may have misunderstood you.
Joined: Jan 09, 2008
You compile using Interface (or super class) references only. These,
of course, must exist when you build the program. Later, you can deliver
the class that implements (or overrides) what was first shipped to give you
the behavior you want. You also must provide the implementing (or child)
class name; with a property file, user entry, etc. Or the class name can
be shipped with the original build.
Jim ... ...
subject: Can a JVM application leverage types that did not exist when the app was compiled?