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
{{ message }}
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.
The only purpose to use Dynamic Properties is to give managers ability to quickly add new property to object without requesting domain model extending. Because shopping cart isn't presented in UI, we should disallow to use Dynamic Properties in cart and related entities like LineItem or Shipment to prevent incorrect usage by developers.
The text was updated successfully, but these errors were encountered:
Lets not remove dynamic properties from lineitem and cart, this is a powerful extensibility model. We should however improve loading of dynamic properties.
It's not only about performance. It's a bad practice to use DPs for any special purpose as they are very uncomfortable for coding.
Just compare:
Cart.DynamicProperties.FirstOrDefault(x => x.Name == "My property")?.Values.FirstOrDefault().Value
and
Cart.MyProperty
Of course, you may write helper, or do ony other stuff. But if adding property require any work from developers side - doesn't matter to put any logic here or add it to UI in special way - there is no one reason to use DPs instead of domain models extending. This possibility not less powerful.
In liquid it should work like this: Cart.DynamicProperties.MyProperty. It still much easier to just add property through UI and then use it in the theme.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The only purpose to use Dynamic Properties is to give managers ability to quickly add new property to object without requesting domain model extending. Because shopping cart isn't presented in UI, we should disallow to use Dynamic Properties in cart and related entities like LineItem or Shipment to prevent incorrect usage by developers.
The text was updated successfully, but these errors were encountered: