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: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Interface with implied Constructor Date: Tue, 23 Jul 2013 18:19:20 -0400 Organization: A noiseless patient Spider Lines: 62 Message-ID: References: <925adeb1-65b5-4a50-86a8-4f04784f8da0@googlegroups.com> <1KhGt.130731$7o1.74691@fx17.iad> <852ru8909m1p1eqcnhpotjpbmv1dd5hmui@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 23 Jul 2013 22:12:52 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="0d73d8cc209bff1c6395088b400d0605"; logging-data="13644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19U7MjpkvV3XlKB+CDzxkzI" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 In-Reply-To: Cancel-Lock: sha1:I+ErWlWrIFtlVXUPi4PBFyOiQrc= Xref: csiph.com comp.lang.java.programmer:24811 On 7/23/2013 5:32 PM, Gene Wirchenko wrote: > On Mon, 22 Jul 2013 16:02:05 -0400, Eric Sosman > wrote: > >> On 7/22/2013 3:39 PM, Gene Wirchenko wrote: >>> [...] I just want a prototype of the >>> constructor with the rest of the prototypes. >> >> I don't think anyone's in doubt about what you and Richard >> want. The question that still burns is: >> >> "Why?" > > An interface documents. I can put additional comments in there > and do because it helps the signatures make sense. Since I have all > this, why not have the constructors there, too? Then, I have the API > documented in one place. An interface documents -- and also specifies, mandates, requires, and enforces. >> Perhaps if you'd offer a concrete example...? To avoid charges > > Read my pargraph above. > >> of made-up-ness, take an existing interface that you think would be >> more useful if it could specify constructors, and exhibit the >> constructors you'd like it to specify. Please use an interface >> that's not some creature of your own; if the idea is useful, there >> surely must be some java or javax interfaces that could use it. >> (If there aren't, that casts some doubt on the utility of the >> construct ...) > > It would document the class in one place. Are you proposing to do away with the class' own JavaDoc? Also, what happens to "in one place" when a class implements more than one interface? > I have already done this. I added comments to my interfaces > stating what the constructor signatures were. I would like to have > Java enforce constructor signatures. Note that I am fine with this > being optional so you need not worry about it. > >> Then, maybe, we can get away from this childish "It's behavior!" >> "No, it's implementation!" back-and-forth. A use case, please. > > For me, it is such a general situation that a use case is gilding > the lily. If you were to ask me for a use case for using a for > statement, it would be about the same level. That level being "beneath contempt," I guess? In summary, we've still seen not even one use case. We've seen assertions by you and by Richard that the capability would be of great utility, yet nobody's offered even one example of a "well-known" interface that could benefit from it. That, I think, should raise a doubt or two. -- Eric Sosman esosman@comcast-dot-net.invalid