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

Change anything requiring additional web requests to be a method instead of a property #40

Open
CrustyJew opened this issue Dec 19, 2016 · 5 comments
Milestone

Comments

@CrustyJew
Copy link
Owner

Historically things have been pulled via Properties on an object like Subreddit.Moderators. Changing everything over to async, this doesn't always work the best as it can't actually call an async method in the getter of a property. You can get around this by calling Task.Run(), but you lose performance benefits from async if I am understanding everything correctly.

Thoughts on how this should be designed going forward? 2.0 is going to break enough stuff that we can safely redesign it however we want most likely.

@CrustyJew CrustyJew added this to the 2.0 milestone Dec 19, 2016
@chuggafan
Copy link
Contributor

properties on objects that are filled at the creation of the object are fine, but otherwise it just looks nicer in the code as a property, but having a method to retrieve it asyncronously if wanted could be done just fine

@CrustyJew
Copy link
Owner Author

I'm leaning towards anything that comes as data with the actual json should be a property. Anything that fires an additional web request should be a method.

@pimanac
Copy link
Contributor

pimanac commented Dec 23, 2016

I like that idea.

Properties shouldn't be that complex anyway.

@pimanac
Copy link
Contributor

pimanac commented Jan 18, 2017

Is this what we've decided on, then? Properties requiring another web call are getting moved to Methods?

@CrustyJew
Copy link
Owner Author

CrustyJew commented Jan 20, 2017 via email

@CrustyJew CrustyJew changed the title Discussion: Accessors vs Properties Change anything requiring additional web requests to be a method instead of a property Feb 15, 2017
@pimanac pimanac mentioned this issue Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants