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


Groups > comp.lang.java.help > #644

Re: Is it sign of bad Object Oriented programming?

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Sun, 24 Apr 2011 16:42:06 -0500
Date Sun, 24 Apr 2011 14:42:01 -0700
From Patricia Shanahan <pats@acm.org>
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version 1.0
Newsgroups comp.lang.java.help
Subject Re: Is it sign of bad Object Oriented programming?
References <87wriklitz.fsf@merciadriluca-station.MERCIADRILUCA> <ip1hhr$ef2$1@dont-email.me> <ip1t77$qlh$1@news.albasani.net> <2IednYrMyuph4inQnZ2dnUVZ_gWdnZ2d@earthlink.com> <ip24hs$bk8$1@news.albasani.net>
In-Reply-To <ip24hs$bk8$1@news.albasani.net>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <pMKdnSrgIf2zBCnQnZ2dnUVZ_gSdnZ2d@earthlink.com> (permalink)
Lines 33
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 75.8.126.96
X-Trace sv3-BM1lZQqdanrNtYfu5rf2Ya8BYjZkvLZp7V5bBVqG6Ng2lfUJrivJQSNPwOZVq7zpCXQkXYStzLy54Q9!rfI9kSDFa22RGcavMRF6tHb8jYHB4VY5VY8s2Jem+xbCAstcgrrvhqHLYXRZjXC/Db8Nd+yksoEn!Uzh0fTrpPEl+wVj7b1lCF5WUSVSANLOq4xq2R+E8Sb0=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2229
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:644

Show key headers only | View raw


On 4/24/2011 2:26 PM, Lew wrote:
> Patricia Shanahan wrote:
...
>> Consider an arithmetic type Widget, like BigInteger, with a multiply
>> method that returns the Widget representing the product of this and a
>> Widget argument.
>>
>> Now write Widget's square method:
>>
>> public Widget square() {
>> return multiply(this);
>> }
>>
>> Is that what is being discussed?
>
> Of course, the OP will have to clarify this, but the example given was:
>
> myObj.myMeth(myObj)
>
> This represents a client, not 'this', calling a method that takes the
> reference itself as an argument. Stefan Ram gave a motivating example:
>
> System.out.println( System.out );
>
> Your example doesn't fit the proffered pattern.
>

OK. Suppose Widget does not offer a square method, but I need the square
of the Widget referenced by x:

Widget xSquared = x.multiply(x);

Patricia

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


Thread

Is it sign of bad Object Oriented programming? Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> - 2011-04-24 00:10 +0200
  Re: Is it sign of bad Object Oriented programming? Lew <noone@lewscanon.com> - 2011-04-23 18:31 -0400
    Re: Is it sign of bad Object Oriented programming? Lew <noone@lewscanon.com> - 2011-04-23 18:32 -0400
  Re: Is it sign of bad Object Oriented programming? Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> - 2011-04-24 00:57 +0200
  Re: Is it sign of bad Object Oriented programming? Roedy Green <see_website@mindprod.com.invalid> - 2011-04-24 06:55 -0700
  Re: Is it sign of bad Object Oriented programming? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-04-24 12:01 -0400
    Re: Is it sign of bad Object Oriented programming? Lew <noone@lewscanon.com> - 2011-04-24 15:21 -0400
      Re: Is it sign of bad Object Oriented programming? Patricia Shanahan <pats@acm.org> - 2011-04-24 12:54 -0700
        Re: Is it sign of bad Object Oriented programming? Lew <noone@lewscanon.com> - 2011-04-24 17:26 -0400
          Re: Is it sign of bad Object Oriented programming? Patricia Shanahan <pats@acm.org> - 2011-04-24 14:42 -0700
            Re: Is it sign of bad Object Oriented programming? Lew <noone@lewscanon.com> - 2011-04-24 21:06 -0400

csiph-web