UR::Manual::Metadata(3pm) | User Contributed Perl Documentation | UR::Manual::Metadata(3pm) |
UR::Manual::Metadata - Overview of the metadata classes in UR
use MyNamespace; my $class_meta = MyNamespace::SomeClass->__meta__; my @property_metas = $class_meta->direct_property_metas(); my @parent_class_metas = $class_meta->ancestry_class_metas(); my $table_obj = UR::DataSource::RDBMS::Table->get( table_name => $class_meta->table_name, ); my @column_objs = $table_obj->columns();
The UR system creates and uses several classes and objects to represent information about the many classes and objects in the system - metadata. For example, for each class, there is an object, called a class metadata object, to represent it. Each property in a class has metadata. So does the relationship between parent and child classes and relationships involved in delegated properties. metadata about any database schemas your namespace knows about is also tracked and stored.
These classes define an API for introspection and reflection, a way for the system to change itself as it runs, and methods for tracking changes and applying those changes to files and databases.
The metadata API is divided into 5 primary parts:
Contexts (UR::Context) and Data Sources (UR::DataSource) provide a filtered view of the data that is reachable through the current Namespace.
UR::Object::Index objects are created by the system to handle get() requests for non-ID parameters.
UR::Change objects represent a change in the system during a software transaction, such as an object's property changind value or creating a new instance of something.
UR::Observer objects manage the change subscription system, where the application can be notified of changes through callbacks. See also "create_subscription" in UR::Object.
2022-01-17 | perl v5.32.1 |