license-maven-plugin icon indicating copy to clipboard operation
license-maven-plugin copied to clipboard

Use strategy pattern to load property-like files

Open digulla opened this issue 5 years ago • 1 comments

For features like missingFile(Url), licenseMergesFile/Url and overrideFile/Url use a strategy pattern to load the resource so we don't have to pass several strings around. All those strategies need to return SortedProperties. This would allow to reuse the code to load those property-like files from any source (incl. common error handling). It would also reduce the number of parameters / fields copied around since you would only have to pass one instance for each feature, no matter how complicated it is configured. If a feature is disabled, we can use a strategy which just returns an empty map.

digulla avatar Jun 21 '19 08:06 digulla

I am open to see the PR. Please note that the number of added lines of code must be proportional to the declared purpose. I see this as a refactoring that should be neutral or ideally negative in terms of added LoC.

ppalaga avatar Jun 22 '19 14:06 ppalaga