Skip to content

Twilio Java SDK 7.x not Object Oriented, using global state? #270

@ceefour

Description

@ceefour

Version: 7.0.rc-10
API Subdomain (api/taskrouter/ip_messaging): api

Code Snippet

Twilio.init(accountSid, authToken);

Feature Request

This seems to be counter to Java best practices including the Spring programming model.

It seems to be using a global state. Which creates a number of issues. One I can think of is a long-running multitenant webapp. It may host several Twilio accounts, one (or more?) for each tenant. A tenant can change their account SID and/or auth token at any time, or remove their Twilio configuration.

On this case only, I prefer the old way, where a TwilioRestClient is using a defined accountSid/authToken and has a clearly manageable lifecycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-generationissue deals with generated code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions