Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: Richard Maher Newsgroups: comp.lang.java.programmer Subject: Interface with implied Constructor Date: Tue, 09 Jul 2013 18:41:28 +0800 Organization: Aioe.org NNTP Server Lines: 20 Message-ID: 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:24716 Hi, I have an interface that requires an implementer to cut code that 99% sure is going to need some variables that are built at run-time. The class to be developed will also be loaded at run-time via Reflection. Most people I have consulted recommend going the null Constructor in combination with Setters, or an INIT() method, to communicate the ambient variables to the loaded class. I, on the other hand, would like to go the Constructor-Injection-esque root of attempting to invoke a version of the Contstructor with the arguments I specify. (Maybe failover to null constructor on InvocationException) Is there something intrinsically wrong with doing this in Java? (I know there are Abstract Classes but I have only Abstract Methods.) If you like to know the real example then what I'd like to pass to the Constructor is the ParentFrame and an Application name. London-to-a-brick the callee will create a Dialog Box. Cheers Richard Maher