Lets say you were designing a Twitter client for people with people could see tweets and post tweets? How would you design the twitter api abstraction? Many of the api wrappers I’ve seen feature an client object that takes as input, the credentials of a user. Something similar to the code below:
twitter = TwitterClient(auth) # maybe (username & password) OR token twitter.post_tweet(message)
To me, this client is now bound to this user and only operate on this user’s account. If another user logs in, should we create another client object or is there a better way? It seems like the program memory would dramatically increase if every user initiated the instantiation of a program object? Is there a better way to this?