watchdog icon indicating copy to clipboard operation
watchdog copied to clipboard

Change preferences API from String-based to Project-based

Open TimvdLippe opened this issue 7 years ago • 1 comments

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.

TimvdLippe avatar May 01 '18 14:05 TimvdLippe

Sounds good. AFAIR, again, the reason for the current implementation are the datatypes the Eclipse persister API supports by default.

Inventitech avatar May 02 '18 14:05 Inventitech