Repository navigation
Decide on extent of OOP in metadata model #1133
Copy link
Copy link
Closed
Labels
decision recordOutcome of this discussion should be tracked in a decision recordOutcome of this discussion should be tracked in a decision recorddiscussionDiscussions related to the design, implementation and operation of the projectDiscussions related to the design, implementation and operation of the projectdocumentationDocumentation of the project as well as procedural documentationDocumentation of the project as well as procedural documentation
Milestone
Description
Activity
- changed the title
[-]Should we create classes for dictionary attributes of inner metadata classes (Targets/Snapshot/Timestamp/Root)[/-][+]Decide on extent of OOP in metadata model[/+]on Sep 10, 2020 - addeddiscussionDiscussions related to the design, implementation and operation of the projectDiscussions related to the design, implementation and operation of the project
on Sep 10, 2020 - addeddocumentationDocumentation of the project as well as procedural documentationDocumentation of the project as well as procedural documentationdecision recordOutcome of this discussion should be tracked in a decision recordOutcome of this discussion should be tracked in a decision record
on Sep 10, 2020 Seems like up to now there is no better suggestion than implementing classes for metadata fields #1139 which can "self-validate" in a similar fashion as in-toto does (with its ValidationMixin #1030) and I think this type of validation is the strongest argument "for" classes.
Maybe wait until a suggestion of an implementation appears in #1139 so we can see it in practice? Meanwhile a brighter idea may come up 🤷
Thanks for reviving the issue, @sechkova. I also think that the metadata validation argument is very compelling. Because in order to validate the metadata schema, we need to define it in some way or another anyway, so we might as well use Python classes, which would also be useful for normal operations.
I can draft an ADR next week.
Metadata
Metadata
Assignees
Labels
decision recordOutcome of this discussion should be tracked in a decision recordOutcome of this discussion should be tracked in a decision recorddiscussionDiscussions related to the design, implementation and operation of the projectDiscussions related to the design, implementation and operation of the projectdocumentationDocumentation of the project as well as procedural documentationDocumentation of the project as well as procedural documentation
Should we create classes for dictionary attributes of inner metadata classes (Targets/Snapshot/Timestamp/Root)?
Con: Seems a bit over-engineered, removes the light-footedness that comes with Python dictionaries
Pro: Makes our use of OOP more consistent.
Why would we use classes for Metadata/Signed/Targets/Snapshot, etc. but not for the inner dicts? (see #1112)
Pro: Makes it easier to validate formats, if complex data structures are defined by classes and simple data types use type annotations. (see #1130)