Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the need for static Node access #19

Open
nikkiii opened this issue Dec 1, 2015 · 2 comments
Open

Removing the need for static Node access #19

nikkiii opened this issue Dec 1, 2015 · 2 comments

Comments

@nikkiii
Copy link
Contributor

nikkiii commented Dec 1, 2015

I've been wondering if it'd be possible through some kind of node repository interface rather than statically setting information... It severely limits operation between several accounts in the same instance when it's linked together by a static account field, and in theory it'd be possible to pass some of the node logic into an object stored in the CloudDrive class.

Just wondering if you have any thoughts to this probably big, and API breaking change before spending the time looking into it.

Unrelated, but Amazon is running a deal on the Unlimited package ($5 for a year), so I'm hoping there will be a boost in usage/available APIs for this service, and I was incredibly happy to find this one!

@alex-phillips
Copy link
Owner

This would definitely be useful. I was debating on the best way to have the node class access the account credentials and information when I built it and really couldn't find a better way other than making the account class a singleton and fetching its instance. Otherwise, You'd have to pass in the account object into each node created or loaded.

One option is to use dependency injection, but that really depends on the implementation of the code. And since this was structured to be an SDK, I didn't want to lock anyone down to extra dependencies and govern how they needed to implement it.

I'm definitely interested in looking at making changes to make this easier and more flexible. If you have any specific examples or suggestions, please let me know!

@nikkiii
Copy link
Contributor Author

nikkiii commented Dec 1, 2015

I was thinking about maybe offloading load* into CloudDrive, returning a Node from there (by using the Account instance in the CloudDrive class), which would probably work quite well... I'll see if I can write a proof of concept, would definitely help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants