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


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

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

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.glorb.com!news.netfront.net!not-for-mail
From Wanja Gayk <brixomatic@yahoo.com>
Newsgroups comp.lang.java.programmer
Subject Re: Abstract Class versus an Interface, when no Members in Common
Date Tue, 8 Nov 2011 23:15:33 +0100
Organization Netfront http://www.netfront.net/
Lines 31
Message-ID <MPG.2923c86ea6df5ded9896d0@202.177.16.121> (permalink)
References <22857359-211e-443e-9c5d-6cc2f5bd971b@m19g2000vbm.googlegroups.com> <3iYsq.9363$zi2.7579@newsfe10.iad>
NNTP-Posting-Host 77.8.33.249
Mime-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding 7bit
X-Trace adenine.netfront.net 1320790530 362 77.8.33.249 (8 Nov 2011 22:15:30 GMT)
X-Complaints-To news@netfront.net
NNTP-Posting-Date Tue, 8 Nov 2011 22:15:30 +0000 (UTC)
User-Agent MicroPlanet-Gravity/3.0.4
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9789

Show key headers only | View raw


In article <3iYsq.9363$zi2.7579@newsfe10.iad>, 
newsgroup.nospam@virtualinfinity.net says...

> Sounds almost like you want a visitor pattern instead, or an 
> intermediate object:
> 
> public class SearchResult {
>     public boolean isSingleArray() { ... }
>     public boolean isMultipleArray() { ... }
> 
>     // Throws IllegalStateException if !isSingleArray
>     public SingleArray getSingleArray() { ... }
>     // Throws IllegalStateException if !isMutipleArray
>     public MultipleArray getMultipleArray() { ... }
> 
> }

That doesn't seem to be any better than the infamous instaceof-cascade - 
I'd rather say it's even uglier.

Kind regards,
-Wanja-


-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

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