Squeak vs. privacy

Blake blake at kingdomrpg.com
Tue Oct 16 10:04:15 UTC 2007


Hey, all,

	I thought the "Tim vs. Accessors" was great. I learned a lot. Everybody  
stated their positions without anyone getting into a high dudgeon, even if  
no minds were changed. And as I originally suggested, the root problem  
seems to be lack of privacy for accessors. (Although I've been toying with  
the argument that if the inst-var needs to be accessed with an accesor to  
encapsulate it from the rest of the class, perhaps IT needs to be its own  
class.)

	Anyway, while I'm a long-time foe of the "private" designation ("no one  
shall ever need to touch this feature again"), I do like the various forms  
of scoping allowed by other languages: protected, public, even published  
(which is a cute trick for a non-reflective language, not really useful in  
Smalltalk).

	At the end of the thread, Tim points out some of the challenges with  
implementing scope, and some kinds:

Class-to-Instance
Instance-to-instance

with which I wholeheartedly agree. 	

	Tim adds:

"Privacy violation
What should happen? An exception? A resumable one? Core dump?"

	I would sugget a DNU should occur.

	My next question, then, is couldn't this be as simple (from the user's  
perspective) as placing methods in specific categories, for example:  
strict private (for self only); private (for class and maybe sibling  
access); protected (for ancestors)? Maybe that's too complicated, dunno.

	My gut feeling is that there's tremendous potential benefit to this; that  
greater encapsulation might help with the rot. But certainly Smalltalk is  
old enough have had something like this done before, so maybe I'm mmissing  
something.

	===Blake===



More information about the Squeak-dev mailing list