| To: | REALbasic NUG <realbasic-nug@lists.realsoftware.com> |
|---|---|
| Subject: | Re: Scope/Protection Question |
| From: | Michael Diehr <md03@xochi.com> |
| Date: | Sun, 31 May 2009 11:47:17 -0700 |
| Authentication-results: | mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com |
| Delivered-to: | listarchive@realsoftware.com |
| In-reply-to: | <4A21F411.70802@inspiringapps.com> |
| References: | <345AFE42-338C-4588-9F76-7560C88B8609@verizon.net> <671647DA-EC14-41EB-A175-5289BBC5E0E3@satx.rr.com> <4A2197C1.1030809@inspiringapps.com> <5EAEA20D-BC8B-490D-8384-C965258AECF7@satx.rr.com> <4A21F411.70802@inspiringapps.com> |
| Reply-to: | REALbasic NUG <realbasic-nug@lists.realsoftware.com> |
| Sender: | realbasic-nug-bounces@lists.realsoftware.com |
On May 30, 2009, at 8:05 PM, Joe Strout wrote: I don't agree. Protected and private are not about restricting access to some properties or methods to the particular objects that own them. Rather, they are about restricting access to the CLASS that owns them. That's why, for example, you can have a shared class method (which is not associated with any instance at all!) that accesses protected private members of objects of its class. In the same way, one object can always access the privates of another member of the same class. Both of these behaviors are quite standard and very useful (in factory functions or for making comparison operators, for example). Yes, I just discovered this while writing a Clone method -- initially I was worried that instance 1 couldn't see / change protected properties in instance 2. I was happy to find out that I was wrong. _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Operator_Compare with variant objects?, Michael Diehr |
|---|---|
| Next by Date: | Re: PC Controller, ER |
| Previous by Thread: | Re: Scope/Protection Question, Joe Strout |
| Next by Thread: | Re: Scope/Protection Question, Norman Palardy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |