Open magro opened 9 years ago
What would be the return value of build()?
The example suggests that the Builder should be part of the JsonHomeClient object. So my guess for the type of the return value would be JsonHomeClient. But JsonHomeClient handles just one host and and is not concerned with caching the json home document. That is why I would expect this kind of Builder in JsonHomeService where build() returns a new JsonHomeService instance.
According to issue #1 I'd rename JsonHomeService to JsonHomeClient, and perhaps just get rid of what's right now JsonHomeClient.
The result of build()
would be AsyncJsonHomeClient (if withCaching
is not used) or JsonHomeClient if withCaching
is used - withCaching would change the interface to a sync/blocking one. Perhaps then the Builder
should be an AsyncJsonHomeClient.Builder
...
It would be nice to have a builder like this: