It might be useful to have an ability to exclude some classes from lazy properties instantiation#5
Merged
AlexDenisov merged 2 commits intorailsware:masterfrom Nov 19, 2013
0xc010d:master
Merged
It might be useful to have an ability to exclude some classes from lazy properties instantiation#5AlexDenisov merged 2 commits intorailsware:masterfrom 0xc010d:master
AlexDenisov merged 2 commits intorailsware:masterfrom
0xc010d:master
Conversation
Contributor
|
@0xc010d, could you rebase your fork so I can merge it automatically? |
AlexDenisov
added a commit
that referenced
this pull request
Nov 19, 2013
It might be useful to have an ability to exclude some classes from lazy properties instantiation
Contributor
|
Sorry for delay, didn't see notifications =\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was decided to derive
<BMLazy>protocol in subclasses and not to require its mentioning in them. Anyhow, sometimes it might be useful to 'skip' lazy properties instantiation for some classes in this hierarchy. So, from now on it's possible to use<BMLazyExclude>protocol to do that. All the properties declared in those 'excluded' classes would not be taken into account when we collect@dynamicproperties for lazy instantiation.Example usage
In this hierarchy class
Ais defined as lazy so its propertyawould be lazily instantiated. ClassBwould also be lazy (as it derives<BMLazy>protocol fromA) so its propertybwould be lazily instantiated as well as inherited propertya.Cis defined as<BMLazyExclude>and inheritsBso its propertycwould not be lazily instantiated whileaandbwould still be lazily instantiated.