Why is sending user id and license key through constructor?
nukec opened this issue · 1 comments
nukec commented
Why do we have to create concrete instance var client = new WebServiceClient(uid, licenseKey);
to get response back? This is antipattern
oschwald commented
The account ID and license key are necessary for use of any of the methods. Further, the classes are intentionally immutable, which make using in a multithreaded environment safer and their behavior easier to understand. I am not sure I follow how this prevents unit testing. You may substitute our the class with a mock.