You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes developers want to use immutable model classes. In this situation the ModelWrapper doesn't work because there is no classical "setter".
The ModelWrapper could provide a way to define fields by using an "Immutable setter" which is a function on an object that takes an argument for a field and returns a new instance of the object with this field changed:
This way the user can change the name in the UI without actually changing the immutable person model that is behind the UI in the viewModel. Instead in the ViewModel one can get a new immutable person instance out of the ModelWrapper that has the new values from the UI.
The text was updated successfully, but these errors were encountered:
Sometimes developers want to use immutable model classes. In this situation the ModelWrapper doesn't work because there is no classical "setter".
The ModelWrapper could provide a way to define fields by using an "Immutable setter" which is a function on an object that takes an argument for a field and returns a new instance of the object with this field changed:
The ModelWrapper should provide methods like this:
This way the user can change the name in the UI without actually changing the immutable person model that is behind the UI in the viewModel. Instead in the ViewModel one can get a new immutable person instance out of the ModelWrapper that has the new values from the UI.
The text was updated successfully, but these errors were encountered: