Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

Deprecate PropertyDescriptor in Contexts #233

Merged
merged 1 commit into from
Jan 9, 2018

Conversation

leekelleher
Copy link
Collaborator

The reason we're using the PropertyDescriptor is due to Ditto original use of TypeConverters.
When we rolled up the TypeConverters and ValueResolvers, we'd kept PropertyDescriptor available.

However the use of reflection in Ditto's internals, there is an additional call made to exclusively get the PropertyDescriptor. If we switch this to use the PropertyInfo, (which we already have a local reference to), then this can be used to access any metadata about the property itself.

So not to make this a rough breaking-change, I'd left the PropertyDescriptor property available on the Contexts, so not to completely ruin the developer experience. I added an obsolete/warning message saying that it would be removed in a future release.

Does anyone foresee any downsides with this approach?

The reason we're using the `PropertyDescriptor` is due to Ditto original use of TypeConverters.
When we rolled up the TypeConverters and ValueResolvers, we'd kept `PropertyDescriptor` available.

However the use of reflection in Ditto's internals, there is an additional call made to exclusively get the `PropertyDescriptor`.
If we switch this to use the `PropertyInfo`, (which we already have a local reference to), then this can be used to access any metadata about the property itself.

So not to make this a rough breaking-change, I'd left the `PropertyDescriptor` property available on the Contexts, so not to completely ruin the developer experience.  I added an obsolete/warning message saying that it would be removed in a future release.

Does anyone foresee any downsides with this approach?
@mattbrailsford
Copy link
Collaborator

Sounds good to me 👍

@JimBobSquarePants
Copy link

PropertyDescripters are slow, ditch em when you can.

@leekelleher leekelleher merged commit 6cd3d9a into develop Jan 9, 2018
@leekelleher leekelleher deleted the dev/deprecate-propertydescriptor branch January 9, 2018 13:30
@leekelleher
Copy link
Collaborator Author

Thanks guys, merged it in!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

3 participants