Skip to content

Decide on extent of OOP in metadata model #1133

Description

@lukpueh

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)

Activity

  1. 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
  2. added
    discussionDiscussions related to the design, implementation and operation of the project
    on Sep 10, 2020
  3. added this to the Foundations milestone on Sep 10, 2020
  4. added
    documentationDocumentation of the project as well as procedural documentation
    decision recordOutcome of this discussion should be tracked in a decision record
    on Sep 10, 2020
  5. sechkova commented on Nov 20, 2020

    @sechkova
    Contributor

    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 🤷

  6. lukpueh commented on Nov 20, 2020

    @lukpueh
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision recordOutcome of this discussion should be tracked in a decision recorddiscussionDiscussions related to the design, implementation and operation of the projectdocumentationDocumentation of the project as well as procedural documentation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions