Skip to content

Change preferences API from String-based to Project-based #299

@TimvdLippe

Description

@TimvdLippe

The current API in the Preferences classes is String-based. This means that it is unclear from the caller what the actual value of the String should be. In my case, instead of using WatchDogUtils.getWorkspaceName() I used project.name in the project registration. Since they are both Strings, it would compile fine. However, all other logic and call-sides of the API used the former rather than the latter.

Therefore, to make this more type-safe, changing the API to use Project instead is more clear. In this case, it should be possible to obtain this project in only 1 way, to make sure the API can only be called with that value. That way, it is clear from the call-side how to retrieve the value, as we limit the amount of possibilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions