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

From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: Abstract Class versus an Interface, when no Members in Common
Date 2011-11-03 18:46 -0700
Organization A noiseless patient Spider
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>

Show all headers | 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


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