Posts

Showing posts from July, 2020

Dynamic Attribute Handler - SAP Hybris

Description: Using Dynamic Attributes, we can add attributes to the hybris Models and create custom logic behind them without saving the attribute in hybris model. Dynamic attribute has some key features: - · The persistence type is set to dynamic, so the attribute value does not persist in the DB. · The attributeHandler points to a bean that must handle the DynamicAttributeHandler interface. · The write attribute is set to false, and therefore the attribute is read-only. How Dynamic Attributes are related to the hybris Model? 1.     The AbstractItemModel type holds a reference to the DynamicAttributesProvider object, which in turn, holds a collection of DynamicAttributeHandler objects. 2.     By using the methods get and set on the DynamicAttributesProvider object, the call is delegated to the valid DynamicAttributeHandler instance. 3.     From user point of view, this process is transparent so only the interaction with th...