BESSER
BESSER copied to clipboard
Class: possibility of adding the same attribute to one class
This kind of situation is possible and it does not throw any exception:
from metamodel.structural.structural import Class, Property
attribute1: Property = Property(
name="attr1", owner=None, property_type=PrimitiveDataType("int"))
attribute2: Property = Property(
name="attr2", owner=None, property_type=PrimitiveDataType("str"))
class1: Class = Class(name="Cls1", attributes=set([attribute1, attribute2]))
class2: Class = Class(name="Cls2", attributes=set([attribute2,]))
This is contrary to the principles of UML, so is it worth to add a "dummy" check?