Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #2959

Why only public methods on interfaces?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!n10g2000yqf.googlegroups.com!not-for-mail
From kramer31 <kramer.newsreader@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Why only public methods on interfaces?
Date Thu, 7 Apr 2011 17:09:51 -0700 (PDT)
Organization http://groups.google.com
Lines 16
Message-ID <25875c94-9af2-4d28-976d-2050a738ae2e@n10g2000yqf.googlegroups.com> (permalink)
NNTP-Posting-Host 66.54.212.101
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1302221392 8703 127.0.0.1 (8 Apr 2011 00:09:52 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Fri, 8 Apr 2011 00:09:52 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info n10g2000yqf.googlegroups.com; posting-host=66.54.212.101; posting-account=eW43AwoAAACwJlMYIWUzfDRxzNTBuIkj
User-Agent G2/1.0
X-HTTP-Via 1.1 genproxy:8080 (squid/2.6.STABLE4-20060927), 1.0 seaproxy1:8888 (IWSS)
X-HTTP-UserAgent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2959

Show key headers only | View raw


Could someone please explain to me the rational behind only allowing
public methods on interfaces?  In my mind, protection and interfaces
are two independent if perhaps somewhat related concepts.

For instance, I have an aspect which creates a proxy of a given
interface (which handles transaction propagation).  Now in order to
use this aspect, I need an interface (otherwise, no proxy can be
created).  However, I have some methods on this class which I would
like to proxy which are public, some are protected, some are package.
Because of this stupid restriction, I have to make all of the methods
public, or do ridiculous things with protection on inner classes.

There are other examples, too.  In fact one could imagine a case where
one would only want protected methods on an interface.

Yuck, Java, yuck.

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar


Thread

Why only public methods on interfaces? kramer31 <kramer.newsreader@gmail.com> - 2011-04-07 17:09 -0700
  Re: Why only public methods on interfaces? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-04-07 21:48 -0300
  Re: Why only public methods on interfaces? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-04-07 21:01 -0400
    Re: Why only public methods on interfaces? v_borchert@despammed.com (Volker Borchert) - 2011-04-08 02:43 +0000
      Re: Why only public methods on interfaces? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-04-08 00:24 -0400
  Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-07 21:49 -0700
    Re: Why only public methods on interfaces? Owen Jacobson <angrybaldguy@gmail.com> - 2011-04-08 01:01 -0400
      Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-07 22:37 -0700
        Re: Why only public methods on interfaces? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-08 00:14 -0700
          Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-08 06:59 -0700
            Re: Why only public methods on interfaces? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-08 07:17 -0700
              Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-08 08:59 -0700
                Re: Why only public methods on interfaces? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-08 17:27 -0700
                Re: Why only public methods on interfaces? "Mike Schilling" <mscottschilling@hotmail.com> - 2011-04-09 22:14 -0700
                Re: Why only public methods on interfaces? "Mike Schilling" <mscottschilling@hotmail.com> - 2011-04-09 22:28 -0700
                Re: Why only public methods on interfaces? Tom Anderson <twic@urchin.earth.li> - 2011-04-10 16:02 +0100
  Re: Why only public methods on interfaces? Roedy Green <see_website@mindprod.com.invalid> - 2011-04-08 03:18 -0700
    Re: Why only public methods on interfaces? Esmond Pitt <esmond.pitt@bigpond.com> - 2011-04-08 20:32 +1000
  Re: Why only public methods on interfaces? Tom Anderson <twic@urchin.earth.li> - 2011-04-08 20:34 +0100
  Re: Why only public methods on interfaces? Tom Anderson <twic@urchin.earth.li> - 2011-04-10 18:10 +0100

csiph-web