[3607] in java-interest

home help back first fref pref prev next nref lref last post

Re: protected is not?

daemon@ATHENA.MIT.EDU (Michael Daconta)
Fri Nov 17 10:28:20 1995

Date: Fri, 17 Nov 1995 06:35:18 -0700 (MST)
To: "D'Arcy Smith" <darcy@arcs.bcit.bc.ca>, java-interest@java.sun.com
From: daconta@PrimeNet.Com (Michael Daconta)

At 08:11 AM 11/16/95 -0800, D'Arcy Smith wrote:

Hi Darcy,

  Thanks for responding.  I agree with you that it sucks.  I have not
done much with packages but do not really see why they should change
such a fundamental concept like data hiding.

  The Java team has done alot of smart things.  I don't see why they
broke compatibility on simple things like the access specifier and 
the command line arguments (primarily no arg 0 as prog name).  
I expect compatibility to be broken on major philosophical differences 
(i.e. operator overloading).

 - Mike

>Michael Daconta wrote:
>>
>> I hear what you are saying but that does not track with the meaning
>> of a Protected variable.  Essentially what you said was - it is
>> only "protected" outside of the package.  That would be a serious
>> change to the idea of access specifiers.
>> 
>> Also, packages are primarily a mechanism to separate namespaces.
>> Being in the same package should have nothing to do with permission
>> to access protected variables.  If that is the default, I think the
>> default should be changed to the same meaning as in C++.
>>
>
>Consider all classes in a package as being friends.
>
>> Changing the meaning of an access specifier even in the same package
>> does serious damage to the concept of encapsulation and data hiding.
>> 
>> I'd rather hope this was a bug.  Java team?  (And the survey says...)
>> 
>
>It appears to be intentional ... I've been modifying the Beta javac
>to try out my idea (see below) ... and the code is quite deliberate.
>Fortunatly the change is small (add a new keyword, check the access
>in a slightly different manner (1 'if' stmt).  The change should only
>take me about 1 hour (Arthur ... 5 mins :-)
>
>Yes this sucks ... I have proposed to this group & to Sun to add
>'shared' access that allows package-wide access thus protected would
>have it's C++ meaning - also the implicit friending would be gone. 
>
>..darcy
>-- 
>   D'Arcy Smith, Systems Analyst
>   Applied Research in Computer Systems (ARCS) Laboratory
>   British Columbia Institute of Technology (BCIT), Burnaby, BC, Canada
>   E-Mail: darcy@arcs.bcit.bc.ca        URL http://www.arcs.bcit.bc.ca
>   Tel:  (604) 432-8281      		Fax:  (604) 436-1297
>
>

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post