In Pharo, methods are �� public �� and instance variables are �� protected ��.
�� protected �� means that the instance variable is only usable from inside the class defining it or from subclasses of the class defining it.
Some languages (as Java) define the concepts of �� private �� method / instance variable which means that the method / instance variable can only be accessed from the class defining it (and not its subclasses) and �� package �� which means that the method / instance variable can only be accessed from classes inside the same package.
In fact, in java you can choose the visibility you want for each method / instance variable. In Pharo, this is fixed, methods are �� public �� and instance variables are �� protected ��. So you do not need to bother.
All these concepts are related to encapsulation [1] which is an important concept of OOP.
BTW, there are some posts related to your question on StackOverflow [2] which I recommend to you.
Cheers,
Julien
Links:
---
Julien Delplanque
Doctorant �� l���Universit�� de Lille
B��timent B 40, Avenue Halley 59650 Villeneuve d'Ascq
Num��ro de t��l��phone: +333 59 35 86 40
Objet: Question about pharo's object model
Date: 15 novembre 2018 �� 05:43:45 UTC+1
hello guys
I'm new to programming, I started programming using pharo, I had a question
about pharo's object model. In object model we say, methods are public. What
does "public" mean here?
thanks
--
Sent from:
http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html