BESSER icon indicating copy to clipboard operation
BESSER copied to clipboard

Class: possibility of adding the same attribute to one class

Open FChikh opened this issue 2 years ago • 0 comments

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?

FChikh avatar Oct 12 '23 09:10 FChikh