IReferenceable

Interface with methods to set refernces for components that depend on other components.

Description

The IReferenceable interface allows you to set references for components that depend on other components.

Important points

  • If component requires explicit notification to unset references, it must also implement the IUnreferenceable interface.

Instance methods

set_references

Sets references to dependent components.

set_references(references: IReferences)

  • references: IReferences - references to locate the component dependencies.

Examples

class MyController(IReferenceable):
    _persistence = None
    def set_references(self, references):
        self._persistence = references.get_one_required(Descriptor("mygroup", "persistence", "*", "*", "1.0"))

See also