I have been following the example of making a class in Pharo from the following link: https://ci.inria.fr/pharo-contribution/job/UpdatedPharoByExample/lastSuccessfulBuild/artifact/book-result/PharoObjectModel/PharoObjectModel.html#fig:colorInstanceClassSide
It is the example of making a Dog and a Hyena class. First I created a package called TestC and in the Instance class I have made the following:
For what I know, and correct me if I am wrong, the instance side is where I create the methods that will work when I instantiate an object while the class side it does not need an object to be created to function; just like a static method class in Java.
The first question that I have at this point is why after Accepting the Changes it stills appear the ! symbol in the left part of my classes?
According to the tutorial then I should put the following code:
Dog class
instanceVariableNames: 'count'
Now I did not where to put it, on the instance side or in the class side, I decided to put it on the instance side the following:
and the last methods that I have are the following, I put them on the class side:
I have tested the classes in the Transcript with the following code:
aDog := Dog new.
Dog count.
bDog := Dog new.
Dog count.
and it works, but I would like to know if I made the right decision to put those methods in the class side (second question), and if its right could anybody give me an example of a method to put in the instance side in this example?
Thanks