Path: csiph.com!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.xdsl-84-44-158-142.netcologne.de!not-for-mail From: Patrick Roemer Newsgroups: comp.lang.java.programmer Subject: Re: double == double Date: Tue, 18 Oct 2016 18:55:21 +0200 Organization: news.netcologne.de Distribution: world Message-ID: References: <8737k0qd38.fsf@golem.phantasia.org> <87zim5es30.fsf@golem.phantasia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 18 Oct 2016 16:55:22 +0000 (UTC) Injection-Info: newsreader4.netcologne.de; posting-host="xdsl-84-44-158-142.netcologne.de:84.44.158.142"; logging-data="10510"; mail-complaints-to="abuse@netcologne.de" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.24) Gecko/20100411 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 X-Mozilla-News-Host: news://news.netcologne.de In-Reply-To: Xref: csiph.com comp.lang.java.programmer:35810 Responding to 4ndre4: > The problem is where encapsulation stops. If you have a class C > containing data D and methods M that act on those data: > > C: > D > M(D) > > within C you have the same problem: a procedural model. > > This is what happens in many OO languages and it's accepted as normal. It should rather be: C holds a reference to another object D, and its methods trigger sending messages to D. There still is (or at least can be) encapsulation of D's state, and, as opposed to the procedural approach, there's late binding - the behavior invoked by a message send depends on the type and state of D. As shown in the Smalltalk/Scala/Ruby examples, the illusion of OO-ness can be maintained down to primitives like doubles. There is no data, it's objects all the way down. ;) Best regards, Patrick