Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Java library should not use singletons

Open
#650 3 comments 16 reactions 0 assignees View on GitHub

@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

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

priority: low status: help wanted type: twilio enhancement

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twilio/twilio-java

All issues in twilio/twilio-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.