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
MiniCartControllerComponent uses CartInSession to find an existing Cart and MyCartBeanFactory to create an empty Cart if no Cart exists for the session, yet.
CartInSession uses TruncatedMiniCartBeanFactory to create a truncated MiniCartBean when serializing a Cart into the session cookie.
The use of MiniCartBeanFactory to create an empty Cart and a TruncatedMiniCartBeanFactory to serialize a non-empty Cart confused me when I was looking for the cause of a bug and makes it harder to introduce a subtype of MiniCartBean. Using TruncatedMiniCartBeanFactory / CartInSession.createMiniCart(...) would require additional null checks in TruncatedMiniCartBeanFactory.
MiniCartControllerComponentusesCartInSessionto find an existingCartandMyCartBeanFactoryto create an emptyCartif noCartexists for the session, yet.CartInSessionusesTruncatedMiniCartBeanFactoryto create a truncatedMiniCartBeanwhen serializing aCartinto the session cookie.MiniCartBeanFactoryto create an emptyCartand aTruncatedMiniCartBeanFactoryto serialize a non-emptyCartconfused me when I was looking for the cause of a bug and makes it harder to introduce a subtype ofMiniCartBean. UsingTruncatedMiniCartBeanFactory/CartInSession.createMiniCart(...)would require additional null checks inTruncatedMiniCartBeanFactory.