Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx03.iad.POSTED!not-for-mail From: Arved Sandstrom User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: Interface with implied Constructor References: <925adeb1-65b5-4a50-86a8-4f04784f8da0@googlegroups.com> <5CiGt.85244$ny.24125@fx14.iad> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Lines: 29 Message-ID: X-Complaints-To: abuse@newsgroups-download.com NNTP-Posting-Date: Fri, 19 Jul 2013 23:46:51 UTC Organization: Public Usenet Newsgroup Access Date: Fri, 19 Jul 2013 20:46:50 -0300 X-Received-Bytes: 2277 Xref: csiph.com comp.lang.java.programmer:24766 On 07/19/2013 07:10 PM, Eric Sosman wrote: > On 7/19/2013 5:56 PM, Arved Sandstrom wrote: >> [...] >> Which is one reason you use abstract classes. If you want to supply >> constructors, implement them, and put them in an abstract class. It's >> the right place: in my continuing opinion ctors are an implementation >> detail. > > Uhm, sorry, I don't get it. Such a constructor would only > be callable from the constructor of a subclass, and there's still > nothing to require that the subclass provide any particular style > of constructor. > > (As mentioned elsethread I don't think interface-mandated > constructors would be useful. I'm just wondering how you'd use > abstract classes to achieve the not-so-useful effect.) > Sure, it's imperfect. The best you can hope for is the the subclass uses one of the provided constructors. It works reasonably well with Exception. But like I said I don't think much of any system that attempts to mandate how a class builds itself. I always figured that was up to the class itself. AHS -- When a true genius appears, you can know him by this sign: that all the dunces are in a confederacy against him. -- Jonathan Swift