Re: Applets and custom class loaders
- From: "a24900@xxxxxxxxxxxxxx" <a24900@xxxxxxxxxxxxxx>
- Date: Tue, 16 Oct 2007 06:05:49 -0000
On Oct 16, 5:38 am, "Qu0ll" <Qu0llSixF...@xxxxxxxxx> wrote:
Is there any reason to use a custom class loader with an applet? I have an
applet in which I only want to load a particular class if the corresponding
content type is required to be rendered by that applet so that the initial
applet load is as quick as possible.
You don't need an additional class loader. Do not put the particular
class file in a Jar. Just put the class file on the server in the
right directory according to the package name. The applet will try to
load the class first time it is referenced. Since it is not in the Jar
(which has already been sent over the net) the class loader needs to
issues a new HTTP request first time the class is needed.
Of course you have to make absolutely sure the class is not referenced
before you use it. Consider programming against an interface and use
Class.forName() to load an interface implementation (your class) to
make sure you have better control over the class usage.
Then additional HTTP requests bear a certain overhead and delay and
therefore the whole idea of delayed loading a class might not be worse
it.
.
- Follow-Ups:
- Re: Applets and custom class loaders
- From: Qu0ll
- Re: Applets and custom class loaders
- References:
- Applets and custom class loaders
- From: Qu0ll
- Applets and custom class loaders
- Prev by Date: Applets and custom class loaders
- Next by Date: Re: Applets and custom class loaders
- Previous by thread: Applets and custom class loaders
- Next by thread: Re: Applets and custom class loaders
- Index(es):
Relevant Pages
|
|