twilio-java icon indicating copy to clipboard operation
twilio-java copied to clipboard

Java library should not use singletons

Open chrylis opened this issue 2 years ago • 2 comments

As a followup to #430, while using global setup such as Twilio.init is ordinary practice in some languages, it is contrary to Java standard practices and substantially interferes in standard Java application architectures.

For version 9 development, your customers would be much better served by following the standard layout of a service interface TwilioApi and a class Twilio implements TwilioApi; this would not impose any more significant burden on consumers (just new Twilio(username, password) instead of Twilio.init(username, password)) but would dramatically enhance testability and some production use cases such as multitenant implementations.

chrylis avatar Oct 01 '21 17:10 chrylis

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

JenniferMah avatar Oct 08 '21 00:10 JenniferMah

My group and I would like to attempt this issue as a part of our uni course, could someone assign me to the issue? Thanks!

edit: PR up, see below

joakim-olsson avatar Mar 01 '22 08:03 joakim-olsson