Java library should not use singletons #650
Labels
status: help wanted
requesting help from the community
type: twilio enhancement
feature request on Twilio's roadmap
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 classTwilio implements TwilioApi
; this would not impose any more significant burden on consumers (justnew Twilio(username, password)
instead ofTwilio.init(username, password)
) but would dramatically enhance testability and some production use cases such as multitenant implementations.The text was updated successfully, but these errors were encountered: