Object model¶
- class besser.BUML.metamodel.object.object.AttributeLink(value: DataValue, attribute: Property)[source]¶
Bases:
objectAn attribute link is a named slot in an instance, which holds the value of an attribute
- Parameters:
- attribute¶
the attribute or property from the structural metamodel.
- Type:
Property
- property attribute: Property¶
Get the attribute.
- Type:
Property
- class besser.BUML.metamodel.object.object.DataValue(classifier: Type, value, name='')[source]¶
Bases:
InstanceAn DataValue represent the value of a property or attribute of an Object.
- Parameters:
classifier (Type) – the classifier of the DataValue. It could be for example a Class or a PrimitiveDataType of the structural metamodel.
value – value of the property Instance.
- classifier¶
Inherited from Instance, represents the classifier of the DataValue instance.
- Type:
Type
- value¶
value of the property Instance.
- _abc_impl = <_abc._abc_data object>¶
- _primitive_type_to_python_type(typename: str)[source]¶
Maps a BESSER primitive type name to the corresponding Python type.
- property value¶
Method to retrieve Value
- class besser.BUML.metamodel.object.object.Instance(name: str, classifier: Type)[source]¶
Bases:
NamedElementThe instance defines an entity to which a set of operations can be applied and which has a state that stores the effects of the operations.
- Parameters:
name (str) – the name of the instance
classifier (Type) – the classifier of the instance. It could be for example a Class or a PrimitiveDataType of the structural metamodel.
- classifier¶
the classifier of the instance. It could be for example a Class or a PrimitiveDataType of the structural metamodel.
- Type:
Type
- _abc_impl = <_abc._abc_data object>¶
- property classifier: Type¶
Get the classifier.
- Type:
Type
- class besser.BUML.metamodel.object.object.Link(name: str, association: Association, connections: list[LinkEnd])[source]¶
Bases:
NamedElementA link represent a relationship between objects.
- Parameters:
name (str) – the name of the Link
association (Association) – the Association that represents the Link
connections – list of link ends.
- association¶
the Association that represents the Link
- Type:
Association
- connections¶
list of link ends.
- _abc_impl = <_abc._abc_data object>¶
- property association¶
Method to retrieve the association
- Type:
Association
- class besser.BUML.metamodel.object.object.LinkEnd(name: str, association_end: Property, object: Object, owner: Link = None)[source]¶
Bases:
NamedElementA link end is an end point of a link.
- Parameters:
- association_end¶
the end of the link
- Type:
Property
- _abc_impl = <_abc._abc_data object>¶
- property association_end¶
Method to retrieve the association end
- Type:
Property
- class besser.BUML.metamodel.object.object.Object(name: str, classifier: Type, slots: list[AttributeLink] = None)[source]¶
Bases:
InstanceAn object is an instance that originates from a class.
- Parameters:
name (str) – the name of the object instance
classifier (Type) – the classifier of the object instance. It could be for example a Class or a PrimitiveDataType of the structural metamodel.
slots (list[AttributeLink]) – list of properties of the instance
- classifier¶
Inherited from Instance, represents the classifier of the object.
- Type:
Type
- slots¶
list of properties of the instance
- Type:
- _abc_impl = <_abc._abc_data object>¶
- _create_link(src_end, tgt_end, target, association)[source]¶
Create a link between the source end and the target object.
- _handle_association_end(key: str, value) bool[source]¶
Handle the case where the key matches an association end.
- _is_internal_attr(key: str) bool[source]¶
Check if the key is an internal attribute of the Object class.
- _set_classifier_attribute(key: str, value) bool[source]¶
Set the value of an attribute if it exists in the classifier’s attributes.
- _set_slot_value(key: str, value) bool[source]¶
Set the value of an attribute link if it exists in the slots.
- add_slot(slot: AttributeLink)[source]¶
Add a slot (attribute) to the object instance.
- property slots: list[AttributeLink]¶
Get the list of slots (attributes) of the object instance.
- Type:
- class besser.BUML.metamodel.object.object.ObjectModel(name: str, objects: set[Object] = None)[source]¶
Bases:
NamedElementAn object model is the root element that comprises a number of objects.
- Parameters:
- _abc_impl = <_abc._abc_data object>¶
- static _conforms_to_type(classifier: Type, expected_type: Type) bool[source]¶
Return True if classifier matches or specializes expected_type.
- static _format_multiplicity(assoc_end: Property) str[source]¶
Render multiplicity bounds readable for error messages.
- _validate_enum_values(errors: list[str])[source]¶
Validate that enumeration attribute values are valid literals of their enumeration.
- _validate_links(errors: list[str])[source]¶
Validate that each link is well-formed and typed correctly.
- _validate_multiplicities(errors: list[str])[source]¶
Verify that each object satisfies multiplicity constraints for every navigable association end.
- _validate_object_completeness(warnings: list[str])[source]¶
Warn about objects with no attribute values defined.
- _validate_unique_object_names(errors: list[str])[source]¶
Ensure each object has a unique name inside the model.