symphonyoss / symphony-java-client

Java client library for Symphony
Apache License 2.0
34 stars 37 forks source link

SymphonyClientConfig should use the Builder pattern #97

Closed pmonks closed 6 years ago

pmonks commented 6 years ago

With the older init methods now deprecated (1, 2, 3), indications are that the SymphonyClientConfig and SymphonyClientConfigID classes are, or will become, the only supported way to initialise Symphony Java Client.

These classes appear to have been introduced to confront the (legitimate!) problem of proliferating constructors with lengthy parameter sets (aka the "telescoping constructor anti-pattern"), however the current solution is at odds with longstanding Java best practice in this area; i.e. application of the Builder pattern. This makes SJC harder to instantiate in many downstream environments (notably those where dependency injection is in use).

It would be preferable if SJC adopted Java best practice here and introduced the Builder pattern, ideally the Step Builder variant.

ftbb commented 6 years ago

I agree and was always in the TODO bucket. Will be in the next release.

pmonks commented 6 years ago

@ftbb oh nice! I already started work on a fix - should I stop? I haven't gotten very far yet, so if you'd prefer to do this yourself I won't have wasted much time / effort.

pmonks commented 6 years ago

I believe this can be closed?