Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Richard Maher Newsgroups: comp.lang.java.programmer Subject: Re: Interface with implied Constructor Date: Wed, 10 Jul 2013 18:03:07 +0800 Organization: Aioe.org NNTP Server Lines: 29 Message-ID: References: NNTP-Posting-Host: jOhPn0KFjrxwuMc9OPMmCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:24723 On 7/10/2013 9:13 AM, markspace wrote: > > I think you should forget reflection loading, and use a regular factory > if at all possible. Even better is to not use a factory and just access > the class directly. Is there a reason you can't just name the class and > use it? You're certain the actual class file must be supplied at > runtime, and can't possibly known at compile time? I do not supply the class to be loaded I just require that the Interface be implemented and that the class is part of the Tier3Client package. > > What do you envision the API to load this class looks like? The public > one your colleagues will see, not your internal implementation. I am adding a new argument HandShake {archive : "myJAR.jar", class : "logon"} to my Tier3Client Javascript class. If it's not there at run-time then the default login Handshake will be used, otherwise it will be appended to the Applet's Archive list and appear on the CP. The class will be loaded by Class.forName(appletParam). Just to sexy for words!!! An before you get up to your old nervous Nelly tricks and FUD about "There be dragons" let me tell you that it all works with an unsigned Applet. Cheers Richard Maher