Skip to content

Enforce type metadata immutability #5

@rjmholt

Description

@rjmholt

Metadata types should be immutable since they describe something that has been read and cannot be changed. There are some challenges to this such as:

  • Nested types may want a reference to their parent, but if the nested type constructs first it can't reference the parent, and if the parent constructs first, it can't contain the children
  • Methods/properties/fields can all have the type they belong to as types or parameter signatures, or worse, nested types

Some solutions here are:

  • Use a prototype pattern to build the structure, with prototypes caching their own instantiation. Then crystallise the whole metadata hierarchy in a second pass
  • Use lazy instantiation. This has the benefit of possibly being more performant for workloads that are only interested in a subset of metadata, but would have overhead in general

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions