Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9EEB619290 for ; Wed, 30 Mar 2016 19:07:14 +0000 (UTC) Received: (qmail 83424 invoked by uid 500); 30 Mar 2016 19:07:14 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 83402 invoked by uid 500); 30 Mar 2016 19:07:14 -0000 Mailing-List: contact users-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.apache.org Delivered-To: mailing list users@groovy.apache.org Received: (qmail 83391 invoked by uid 99); 30 Mar 2016 19:07:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2016 19:07:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id D66CF180450 for ; Wed, 30 Mar 2016 19:07:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.299 X-Spam-Level: X-Spam-Status: No, score=0.299 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id UaXR8IeN_Cob for ; Wed, 30 Mar 2016 19:07:11 +0000 (UTC) Received: from smtp.czechia.com (smtp1.czechia.com [217.198.120.39]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 071BD5F2ED for ; Wed, 30 Mar 2016 19:07:10 +0000 (UTC) Received: from [10.0.0.123] (31.4.broadband2.iol.cz [83.208.4.31]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ocs@ocs.cz) by smtp.czechia.com (Postfix) with ESMTPSA id 342EB20280908 for ; Wed, 30 Mar 2016 21:07:10 +0200 (CEST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: interface/implementation patten From: OC In-Reply-To: <56FC1F8C.3090007@gmx.org> Date: Wed, 30 Mar 2016 21:07:23 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <64F3A2B8-4161-473B-B191-2A4A7FA7F54B@ocs.cz> References: <1459093137891-5732080.post@n5.nabble.com> <1459150970302-5732082.post@n5.nabble.com> <1459173202252-5732085.post@n5.nabble.com> <0CD793C2-B644-43CF-8E6B-22F19EB7F696@ocs.cz> <56FBECE0.1070308@gmx.org> <56FC1F8C.3090007@gmx.org> To: users@groovy.apache.org X-Mailer: Apple Mail (2.1510) Jochen, On 30. 3. 2016, at 20:48, Jochen Theodorou wrote: > I am unhappy about the semantics of static methods in general in Java = and that we copied most of it in Groovy... You are telling me :) Hardly you can have missed my occassional bitter = rants re static =84methods=93 :) I sort of recall we debated ages ago whether there might be a way to = turn them to real full-fledged class methods, properly inheritable with = a real =93this=93 representing the receiver, not the implementor; but I = am afraid the result of that conversation was that something like that = would be somewhere at the edge betwixt =93impossible=94 and = =93impractically difficult=94 :( > extending that to interface is for me no good decision... but well... I would be infinitely happier if those jokers in Sun have designed the = thing properly (it's not just static =93methods=93, it's much more -- = including the =93Cannot cast object=94 exception howler of the other = thread); but well, they did not, triple alas. Anyway, far as static =84methods=93, with all their shortcomings, can be = part of the class API, I am afraid the interface needs to be able to = contain the things. After all, that's the purpose of the interface: to = define the public API of the class; no less, no more. If the public API = can contain those uglies, the interface should, too. Or am I overlooking something of importance here? > I guess it is up to you. I know of nothing in that area to make this = less painful OK, thanks; I guess I'll try to rig some kind of private preprocessor = reading sources which would contain ObjC-like class directives, and = generating the appropriate .groovy files with all the interfaces, = implementations, factories etc. After all, ages ago the C preprocessor = used to be implemented this very way, and it worked well. It would complicate somewhat the incremental build on one side, and = error reporting (more precisely, matching the reports to sources) on the = other; but the problems should not be insurmountable, I guess -- I need = to postprocess error reports anyway, since I use Xcode instead of = Eclipse, and thus I have to squeeze the reports so that Xcode = understands them. And the big advantage (against the ASTT approach) = would be no problem with traits :) Thanks again a very big lot and all the best, OC