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


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

Re: beginning java...nublet drowning. throw me a lifeline?

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: beginning java...nublet drowning. throw me a lifeline?
References <89baf7bb-7b1d-4bc0-80ba-a4881de09810@t16g2000yqt.googlegroups.com> <eupmp7tqd5qlfs0egfmrf2kbqcf7fr8r4m@4ax.com>
Message-ID <KyTmr.72330$YM2.44727@newsfe05.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2012-04-28 11:56 -0300

Show all headers | View raw


On 12-04-28 12:48 AM, Roedy Green wrote:
> On Fri, 27 Apr 2012 16:20:12 -0700 (PDT), Justin Fondriest
> <jfondriest82@gmail.com> wrote, quoted or indirectly quoted someone
> who said :
> 
>> Now whether I am right or wrong...could someone take maybe 3 minutes
>> to explain what composition is in layman's terms?
> 
> see http://mindprod.com/jgloss/isa.html
> 
> There are two ways to extend a class.
> 
> An Elephant class might extend a Mammal class because an elephant is a
> mammal.
> 
> An Elephant class might have a variable of the Trunk class because an
> elephant has a trunk
> 
> That is all that gobbledygook means.

I don't like thinking of composition (has-a) as extension - usually. You
didn't extend "Trunk" at all: there is no other new class in the system
that "is-a" Trunk.

I could see the use of the word "extend", more in the natural language
sense than in the OO sense perhaps, if we talked about some object-based
structural patterns where composition is used, and it had to do with
"reshaping" objects of a single class (degenerate composites, so to
speak). For example, decorator or object-based adaptor.

However, as soon as composition is being used to assemble a brand new
thing, out of several or many objects of various classes, I don't really
see any "extension".

AHS
-- 
A fly was very close to being called a "land," cause that's what they do
half the time.
-- Mitch Hedberg

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


Thread

beginning java...nublet drowning.  throw me a lifeline? Justin Fondriest <jfondriest82@gmail.com> - 2012-04-27 16:20 -0700
  Re: beginning java...nublet drowning.  throw me a lifeline? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-04-27 21:48 -0400
  Re: beginning java...nublet drowning.  throw me a lifeline? markspace <-@.> - 2012-04-27 20:28 -0700
    Re: beginning java...nublet drowning.  throw me a lifeline? Lew <noone@lewscanon.com> - 2012-04-28 12:42 -0700
  Re: beginning java...nublet drowning.  throw me a lifeline? Roedy Green <see_website@mindprod.com.invalid> - 2012-04-27 20:48 -0700
    Re: beginning java...nublet drowning.  throw me a lifeline? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-28 11:56 -0300

csiph-web