From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,36a29c2860aff686 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Newsgroups: comp.lang.ada Subject: Re: (placepo) Properties References: <3b84c8e7-1a51-4a7c-9646-119f1fc51478@s4g2000yql.googlegroups.com> <4cf24d13$0$6985$9b4e6d93@newsspool4.arcor-online.net> <4cf6d91e$0$6980$9b4e6d93@newsspool4.arcor-online.net> Date: Sun, 05 Dec 2010 17:15:28 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Martin Krischik" Organization: Martin Krischik, Softwareentwicklung Message-ID: User-Agent: Opera Mail/10.63 (MacIntel) NNTP-Posting-Host: 89.236.182.97 X-Trace: news.sunsite.dk DXC=Q\b?8KI^7`BKJ1ZiZQ]7SLYSB=nbEKnkK=Wf0P_7c\ZFS5daR30PdPEV:_8RJBabHM?QA2cYN[o4A Am 02.12.2010, 00:24 Uhr, schrieb Georg Bauhaus : > I don't see how "automatic" get/set subprograms offer > software engineering advantage, even when they are terse > and semi-implicit and purport to avoid repetitive clutter. Actually they don't. Not if you can't replace the automated get/set with a user defined function. Especially for set this is important as set should check the value and notify observers of the change. I see far to many mutators which neglect this. And get should protect the value from outside changes by by either returning the value as constant or by coping the value. But especially in Java I often wonder why accessors and mutators are used at all. For example in Scala where accessors and mutators are automaticly generated (without get and set prefix as Scala is functional [1]) this has come back to haunt the language as it becomes very complicated to create rich accessors and mutators. Ok, one thing is left: properties can be overridden. For example a abstract property can be defined in an interface. Martin [1] Which makes me wonder: The set and get prefix are not needed in Ada or Java - so why not do without them? -- Martin Krischik mailto://krischik@users.sourceforge.net https://sourceforge.net/users/krischik