DiceTechnology / dice-where

IP to Location lookup library
MIT License
3 stars 0 forks source link

Turn parser ctors into builders #38

Open gedl opened 5 years ago

gedl commented 5 years ago

Some providers will have more complex instantiation for their readers. For example Maxmind can use a combination of ip versions and/or VPN information. The only mandatory file is the country code to country name mapper.

For this reason, the ctors should be turned into builders to be easier to choose which files to load.

This can also apply to other database providers.

SavvasMichael commented 5 years ago

Should we consider Lombok for this kind of functionality? A single annotation could provide you with a builder for a class, which will remove many lines of code and is exactly what we need.

We also get other nice to have stuff out of the box such as toString() method creation and getters and setters for fields, which we might choose to use, or not to. I have used it in the past and it I definitely think it makes a project look better overall. https://projectlombok.org/features/all

I could provide a PR showcasing Lombok(changing a couple of classes) and if its agreeable I can bake it in the project

SavvasMichael commented 5 years ago

Discussion led to the fact that we don't want to introduce Lombok as it would drag in unwanted complexity for the users(lombok plugin-annotation processing etc)