This repository was archived by the owner on Jun 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Use of ViewModels in session is not transparent #682
Copy link
Copy link
Open
Labels
Milestone
Description
- When
ViewModels are serialized to the session and then deserialized, the data fromViewModel.extendedViewModelis lost. - Since
ViewModel.extendedViewModelworks fine in Handlebars, losing this information during session handling was unexpected to me. - We stumbled upon this problem when we wanted to add a boolean field to
MiniCartBean. Not using the extended view model but introducing a subclass ofMiniCartBeanis undoable because- Inconsistent use of (Truncated)MiniCartBeanFactory #681
- CartInSession having all private fields so a lot of information needs to be duplicated in the subclass
MiniCartBeanFactory.create(Cart)not delegating to a separately overridable method that creates a Bean instance and at the same time being invoked viasuper.create(...)fromTruncatedMiniCartBeanFactoryso our subclass ofTruncatedMiniCartBeanFactorycannot overrideMiniCartBeanFactory.create(Cart)in an effective way. Of course we could start copying more ofTruncatedMiniCartBeanFactorybut code copying has limits, right?
- We would like to show a message in the minicart explicating that it has been truncated. We're not able to do that right now due to above limitations.