dkan icon indicating copy to clipboard operation
dkan copied to clipboard

Metastore code refactor for clearer naming and flow

Open dafeder opened this issue 3 years ago • 0 comments

Proposal to tighten up the naming and typing conventions in the metastore module. Some changes are simply renaming or separating existing classes/methods, but others change the types being passed around. The current code is difficult to understand and maintain.

This assumes that the metastore module has been merged into the dkan module (see #3746).

Drupal\dkan\Metastore\Item

Classes and interfaces for defining Metastore item objects. These will be the primary metadata objects passed around the system.

Class Description
Drupal\dkan\Metastore\Item\MetastoreItemInterface Interface for a metastore item object
Drupal\dkan\Metastore\Item\MetastoreEntityItemInterface Extension interface for entity-based items
Drupal\dkan\Metastore\Item\MetastoreNodeItem Metastore item class based on a node.

Drupal\dkan\Metastore\Schema

Classes for defining, retrieving and validating against metastore schemas. Note that SchemaManager replaces the old SchemaRetriever service. Assumes completion of #3761.

Class Description
Drupal\dkan\Metastore\Schema\MetadataValidator Utility class for validating metadata against a schema in the system.
Drupal\dkan\Metastore\Schema\MetastoreSchema Schema plugin definition, for schemas that will be defined in YAML.
Drupal\dkan\Metastore\Schema\MetastoreSchemaInterface Interface for schema plugins.
Drupal\dkan\Metastore\Schema\SchemaManager Plugin manager to gather definitions and retrieve schemas.

dafeder avatar Jan 08 '22 00:01 dafeder