Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: Interface with implied Constructor Date: Tue, 09 Jul 2013 18:13:59 -0700 Organization: A noiseless patient Spider Lines: 31 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 10 Jul 2013 01:08:18 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="fba3415ba68d85d643935af2f52f0b4b"; logging-data="16779"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18k7T/tXW7j3YQMGRd9kp48I19ldt3FG1U=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: Cancel-Lock: sha1:kCu/gEAoXQ2+/YhS3uYb0NbYoGQ= Xref: csiph.com comp.lang.java.programmer:24720 On 7/9/2013 3:41 AM, Richard Maher wrote: > Most people I have consulted recommend going the null Constructor in > combination with Setters, or an INIT() method, to communicate the Well, that's something to consider. Personally, I don't see much difference, although you've given us no details as to what you are actually doing here, or any particulars at all. If most people you consult say not to do something, maybe they know something we don't. You may wish to compare with Java's DriverManager, which will load and configure a class based on a single init string. DriverManager.getConnection( "jdbc:vendor://username:password" + "@domain:port/schema", connectionProps); That isn't terrible, but it's not particularly elegant either, and your colleagues may be concerned with maintenance issues, or other things. 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? What do you envision the API to load this class looks like? The public one your colleagues will see, not your internal implementation.