[Pharo-dev] Traits question

phil at highoctane.be phil at highoctane.be
Sun Nov 3 15:39:23 EST 2013

I have a TXXLog Trait where I have defined the following methods instance

info: aString
warn: aString
debug: aString
error: aString

This worked well with my services where I had XXService uses: TXXLog

services have a default class side method that return the Default instance.

Now, I had a class where I wanted to use the trait from the class side as

But then, after Googling a bit, I found that there was the instance side
trait and the class side trait.

What is the best practice when one wants to use, say, the TXXLog trait on
the class side?

For my particular case, I put the info: warn: ... methods on the class side
of my trait and the instance side one do a self class info: aString etc.

Is that the right way to do it?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20131103/740016f8/attachment-0002.html>

More information about the Pharo-dev mailing list