I want to build some scala classes to model RDF. I have classes and properties. The properties are mixed in to the classes and can use the properties
hashmap because of their self type.
As the classes get more properties I have to use a lot of mixins (50+) and I wonder if this is still a good solution performance wise?
trait Property
trait Properties {
val properties =
new scala.collection.mutable.HashMap[String, Property]
}
abstract class AbstractClass extends Properties
trait Property1 {
this: AbstractClass =>
def getProperty1 = properties.get("property1")
}
trait Property100 {
this: AbstractClass =>
def getProperty100 = properties.get("property100")
}
class Class1 extends AbstractClass
with Property1 with Property100