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


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

Re: java inheritance

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.java.programmer
Subject Re: java inheritance
Date Mon, 11 Nov 2013 19:19:17 +0100
Lines 44
Message-ID <becldeF7cdaU1@mid.individual.net> (permalink)
References <88bf3eb6-4f5a-4745-9bea-fcc4bdaba816@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net BnayLjXxBhycmR+p24OqRw32eNsN6ynVO6iFAx5K3wlYFfN8s=
Cancel-Lock sha1:1awAe5j1/ebtcrNPJm4Jxcvkj7k=
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
In-Reply-To <88bf3eb6-4f5a-4745-9bea-fcc4bdaba816@googlegroups.com>
X-Antivirus avast! (VPS 131111-0, 11.11.2013), Outbound message
X-Antivirus-Status Clean
Xref csiph.com comp.lang.java.programmer:26498

Show key headers only | View raw


On 11.11.2013 14:30, asdf9797 wrote:
> Hi
>
> I did a java test recently and one of the questions was on the subject of
> inheritance/ OO design
>
> The idea was there was a "Storable" abstract class which contained a store() method.
>
> There was a IStorable interface
>
> And then there was
>
> class Book extends Storable implements IStorable {
>     public void save(Book) {
>     }
>
> }
> The question was how to improve the implementation.

Get rid of the argument of method save().  A Book has immediate access 
to all its state.

If at all, you would want to pass something like a Store, a Store 
interface or something which is able to store data.  For that it would 
have to exhibit methods for basic store operations much like DataOutput 
does.

http://docs.oracle.com/javase/7/docs/api/java/io/DataOutput.html

> What is the current thinking on extending abstract classes ?

Extending abstract classes is absolutely necessary.

> Is that the issue?

What?

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

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


Thread

java inheritance asdf9797 <paul.caffrey@gmail.com> - 2013-11-11 05:30 -0800
  Re: java inheritance Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-11-11 09:12 -0500
  Re: java inheritance Arne Vajhøj <arne@vajhoej.dk> - 2013-11-11 09:40 -0500
  Re: java inheritance markspace <markspace@nospam.nospam> - 2013-11-11 09:45 -0800
    Re: java inheritance Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-11-18 09:24 -0400
  Re: java inheritance Robert Klemme <shortcutter@googlemail.com> - 2013-11-11 19:19 +0100

csiph-web