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


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

Re: Abstract Class versus an Interface, when no Members in Common

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: Abstract Class versus an Interface, when no Members in Common
Date Thu, 03 Nov 2011 18:46:57 -0700
Organization A noiseless patient Spider
Lines 27
Message-ID <j8vg6j$ihn$1@dont-email.me> (permalink)
References <22857359-211e-443e-9c5d-6cc2f5bd971b@m19g2000vbm.googlegroups.com> <j8vc3o$sks$1@dont-email.me> <21089688.186.1320369008216.JavaMail.geo-discussion-forums@prev11>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Fri, 4 Nov 2011 01:47:00 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="18999"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eRMJSMRLO609uIFkBSmUE5MlDH+dWbwQ="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
In-Reply-To <21089688.186.1320369008216.JavaMail.geo-discussion-forums@prev11>
Cancel-Lock sha1:RjRDAVNmnxJpx2rILPzLylKxetM=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9495

Show key headers only | View raw


On 11/3/2011 6:10 PM, Lew wrote:

> The OP's approach seems somewhat hackish, based on the paucity of
> information provided so maybe it isn't.  Would it work to make the
> varying type a generic parameter?


He'd have to add some sort of method(s) to support the generic 
parameter.  Some kind of generic mix-in:

public interface MixMe<T> {}

Seems silly to me, without something specified to be done with T.  Like 
wise a base class with a single generic getter:

public BaseGetter<U> {
   public U get();
}

doesn't seem any different than just making a regular non-generic 
sub-class.  Arne's point of just declaring the methods and return types 
you need in one class seems the most straight forward.

I think he just has to be prepared to refactor a lot of code when the 
right way to do it becomes apparent.  What he's got right now could go 
any way at all.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Abstract Class versus an Interface, when no Members in Common KevinSimonson <kvnsmnsn@hotmail.com> - 2011-11-03 16:09 -0700
  Re: Abstract Class versus an Interface, when no Members in Common Arne Vajhøj <arne@vajhoej.dk> - 2011-11-03 19:32 -0400
  Re: Abstract Class versus an Interface, when no Members in Common markspace <-@.> - 2011-11-03 17:37 -0700
    Re: Abstract Class versus an Interface, when no Members in Common Lew <lewbloch@gmail.com> - 2011-11-03 18:10 -0700
      Re: Abstract Class versus an Interface, when no Members in Common markspace <-@.> - 2011-11-03 18:46 -0700
  Re: Abstract Class versus an Interface, when no Members in Common Roedy Green <see_website@mindprod.com.invalid> - 2011-11-03 22:06 -0700
  Re: Abstract Class versus an Interface, when no Members in Common Ian Pilcher <arequipeno@gmail.com> - 2011-11-04 00:06 -0500
  Re: Abstract Class versus an Interface, when no Members in Common Robert Klemme <shortcutter@googlemail.com> - 2011-11-04 17:57 +0100
  Re: Abstract Class versus an Interface, when no Members in Common Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-11-04 13:54 -0700
    Re: Abstract Class versus an Interface, when no Members in Common Wanja Gayk <brixomatic@yahoo.com> - 2011-11-08 23:15 +0100
      Re: Abstract Class versus an Interface, when no Members in Common Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-11-08 20:58 -0800
  Re: Abstract Class versus an Interface, when no Members in Common Roedy Green <see_website@mindprod.com.invalid> - 2011-11-04 15:17 -0700
  Re: Abstract Class versus an Interface, when no Members in Common Wanja Gayk <brixomatic@yahoo.com> - 2011-11-08 23:13 +0100

csiph-web