Java library should not use singletons
@joakim-olsson is already working on this.
Since Mar 1, 2022.
- #675 by @SimonOsnes — closed without merging
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- api, backend-api-design
Research direction
Start by reviewing the current global initialization around Twilio.init and the context from followup issue #430. Compare the existing client structure with the proposed TwilioApi interface and Twilio implementation. Done means establishing whether this architectural change is feasible for version 9 while preserving the stated consumer use cases.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 529
- Forks
- 453
- Avg merge
- 1h 14m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from twilio/twilio-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
twilio/twilio-java#976 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
twilio/twilio-java#975 ·
-
[BUG] Sip.Builder(String) drops SIP destinations with an explicit port when the scheme is omittedOpentype: bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
twilio/twilio-java#982 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
twilio/twilio-java#960 ·
-
MessageIntent is not supported in the Java SDKMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
twilio/twilio-java#950 · 2 comments ·
All issues in twilio/twilio-java
Similar issues
-
[BUG] 订单:会员凭订单号即可取消其他会员的待付款订单(取消接口不校验订单归属)Possibly taken @dadiyang claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
macrozheng/mall#1016 ·
-
[Bug] The producer summary counts an unreported client version as a second version and warns about a version mixPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/rocketmq-dashboard#6110 ·
Maintainers usually reply within 4 days
-
Python 3.15 supportPossibly taken @amnesiaof claimed this today. OpenL: python L: python:uv
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dependabot/dependabot-core#16524 · 1 comment ·
Maintainers usually reply within 1 day
-
`Processing lsp` never exits and leaves orphaned processesPossibly taken @overcast302 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
processing/processing4#1578 · 1 comment ·
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PlayersCommittee/gemp-swccg-public#1174 ·
Maintainers usually reply within 2 days