Better put the methods in the case class; Isn't that the whole point of classes in general? object is static and is usually a bad place for methods, as this means that they need to take one more argument than otherwise. I would expect the method in the class to work very slightly better, since it will not need to load an instance of the companion object (and, more generally, it is closer to the style that is optimized for the JVM), but this is almost certainly also a small difference in matter in any real program. Of course, no rule is absolute; if you find that a particular method is better suited for a companion object, be sure to put it there.
lmm
source share