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

Use TypedPropertyBag instead of PropertyBag by default in ModelBase #1491

Open
GeertvanHorrik opened this issue Nov 25, 2019 · 5 comments
Open

Use TypedPropertyBag instead of PropertyBag by default in ModelBase #1491

GeertvanHorrik opened this issue Nov 25, 2019 · 5 comments
Assignees
Milestone

Comments

@GeertvanHorrik
Copy link
Member

@GeertvanHorrik GeertvanHorrik commented Nov 25, 2019

See discussion at #1319

The ModelBase class will have a CreatePropertyBag virtual method that returns the TypedPropertyBag by default. Users can override this method to customize / restore the old behavior by returning the PropertyBag instead.

@GeertvanHorrik GeertvanHorrik added this to the 5.12.0 milestone Nov 25, 2019
@GeertvanHorrik GeertvanHorrik self-assigned this Nov 25, 2019
@GeertvanHorrik

This comment has been minimized.

Copy link
Member Author

@GeertvanHorrik GeertvanHorrik commented Nov 25, 2019

We must ensure that this works well everywhere, especially since the TypedPropertyBag does not accept object types for properties registered as different types.

@GeertvanHorrik

This comment has been minimized.

Copy link
Member Author

@GeertvanHorrik GeertvanHorrik commented Nov 25, 2019

The TypedPropertyBag should be improved so it can deal with SetValue for non-object types. It should check whether the property is already registered as a specific (value) type. If so, then cast to that instead or throw an exception if that's impossible.

@GeertvanHorrik

This comment has been minimized.

Copy link
Member Author

@GeertvanHorrik GeertvanHorrik commented Nov 25, 2019

TypedPropertyBag will now try to cast properties in case they are passed in as object.

GeertvanHorrik added a commit that referenced this issue Nov 25, 2019
…Base
@GeertvanHorrik

This comment has been minimized.

Copy link
Member Author

@GeertvanHorrik GeertvanHorrik commented Nov 25, 2019

Causing too much of a breaking change, see #1493 . Will use the default PropertyBag for now, will change in 6.0

@GeertvanHorrik GeertvanHorrik modified the milestones: 5.12.0, 6.0.0 Nov 25, 2019
@stale

This comment has been minimized.

Copy link

@stale stale bot commented Jan 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 24, 2020
@GeertvanHorrik GeertvanHorrik added planned and removed wontfix labels Jan 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.