Not exactly sure how to phrase this question. In java if you have a static instance var and the owning class is in tomcat/classes or tomcat/lib so that many different web apps (children of the tomcat class loader) can use it, changing the static var in one web app will affect the others.
Is this also true of a Scala companion object? From what I understand under the hood Scala singleton objects are compiler created singleton Java classes referenced by a static variable. So the answer would be yes. If web app A creates a new scala Foo and web app B creates a new scala Foo and the Foo class is from a parent class loader, each web app will have its own instance of Foo, but really only one instance of Foo's companion object.
Am I missing something here?
Thanks in advance for any insight.