Skip to content

Conversation

@richardjrossiii
Copy link
Contributor

Similar to the subclassing architecture used on iOS, this abstracts and cleans up all of the code relating to subclassing that currently resides inside of ParseObject.

Tests coming soon™.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More line-ending BS. I'll try and fixup this part of the commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to do this during initialization and drop the mutex? Or, to put it more succinctly, is there ever a time when you would register a subclass but never need to look up the property mappings?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Let's put this inside initialization and drop the mutex. Every call to [], Set, Remove, or even a simple ObjectId will call this props. So optimistically creating this this for every subclass will always be useful.

@richardjrossiii richardjrossiii force-pushed the richardross.subclassing.decouple branch from c45e7d9 to e7caf82 Compare November 5, 2015 21:58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious, any reason we're using ReaderWriterLockSlim here instead of using usual lock(mutex) other than the performance boost it gives?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hallucinogen that's really the only reason. I figure this will be a high-throughput critical section, and for most accesses there's no need to be exclusive.

@hallucinogen
Copy link
Contributor

The build is failing. And the cause seems valid

@richardjrossiii richardjrossiii force-pushed the richardross.subclassing.decouple branch 2 times, most recently from aff163d to 435559a Compare November 16, 2015 18:52
Similar to the subclassing architecture used on iOS, this abstracts and cleans up all of the code relating to subclassing that currently resides inside of ParseObject.
@richardjrossiii richardjrossiii force-pushed the richardross.subclassing.decouple branch from 435559a to 95cfdb4 Compare November 16, 2015 21:19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah. I see it. This is good.

@hallucinogen
Copy link
Contributor

Well done!

richardjrossiii added a commit that referenced this pull request Nov 16, 2015
@richardjrossiii richardjrossiii merged commit 9d51b34 into master Nov 16, 2015
@richardjrossiii richardjrossiii deleted the richardross.subclassing.decouple branch November 16, 2015 21:29
@richardjrossiii richardjrossiii added this to the 1.6.2 milestone Nov 17, 2015
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

Successfully merging this pull request may close these issues.

4 participants