Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #624
| From | Lew <noone@lewscanon.com> |
|---|---|
| Newsgroups | comp.lang.java.help |
| Subject | Re: Is it sign of bad Object Oriented programming? |
| Date | 2011-04-23 18:31 -0400 |
| Organization | albasani.net |
| Message-ID | <iovjvm$jdp$1@news.albasani.net> (permalink) |
| References | <87wriklitz.fsf@merciadriluca-station.MERCIADRILUCA> |
Merciadri Luca wrote: > Let us consider a class Class and an object myObj of type Class. Let > there be a method myMeth defined in the Class class. > > Are there some cases where typing e.g. > == > myObj.myMeth(myObj) > == > is not considered as `bad style?' That is, are there, more generally, > some situations where passing an instanciated object to a method of > this object is a good way of achieving something? > > I wondered this when I was coding something. Thanks. There is no relationship between that idiom and style, good or bad. The question is what, if any, value the idiom provides, and on the face of it I see none. On the other hand, that hidden scenario that you refused to share that motivated your question might motivate a similar question for us. However, absent the context that you refused to share, it's impossible to know what benefit you project the idiom might provide. The reason I don't see any value is that, for an instance method of a class 'Foo' and an invocation of that method through an instance 'foo', the method already has access to 'this'. What possible benefit could there be to providing an additional pointer to the same object through the argument list? Please note that I asked a question to which I sincerely hope for an answer from you. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar
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