Skip to content

Better Versioning Of Resources #313

Open
@Michaelpalacce

Description

@Michaelpalacce

Description

Changes to the APIs in different solutions lead to a lot of checks of which minor/patch version we are using of a specific API and then doing some complex conditionals inline at random places to trigger different logic. This should be improved.

**NOTE: This Issue is NOT related to major version changes, rather only for minor and patch versions! How major changes are handled is a part of #305

Proposed change

  • We need to separate parts of the business logic of specific stores away from the stores themselves and move it to a separate class
    • This class will be created by a Factory, given the version we want
    • Versioning will work by:
      • Add a map with versions pointing to Classess for that version
      • Have a default option for things that are unmatched
      • Versions will match up to a version, aka if you have version 8.8 everything under: 8.0...8.8 will get that specific Class
      • If you have a version 8.8 and 8.10, then 8.9 will go to 8.10
      • Each versioned class will essentially be a patch from the default one
    • The versioned classes returned by the factory will implement the strategy pattern and the stores will use the correct strategy based on what was returned by the factory.

Example of this in Typescript:

Client Map:
image


Example factory function:
image


Example Patch Class:
image
with the super:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/artifact-managerRelates to the `artifact-manager` maven modulekind/refactorRefactoring of existing featureslang/javaRelated to Java Codetriage/blockedThis issue is blocked by another, specified in the description

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions