-
Notifications
You must be signed in to change notification settings - Fork 152
Persistence Layer #68
Description
As a Magento Developer, I need a GraphQL persistence layer that provides flexible and performant data retrieval so that my web application is fast and leads to increased conversions.
A persistence layer would also provide a persistence-agnostic way to declare, store, and extend entities.
An entity is a set of associated fields that are used for the purpose of data changes and data retrieval. Each entity introduced by Module should be declared in entities.xml file. In each specific business case entity is represented as a unit of fields (DTO), aka subset of fields listed in the entity declaration. Each field describes type, format and validation rules which should be applied. Also, entity's declaration represents relationship between entities (aka Aggregate Root)
Service Responsibility is to convert DTO interface passed as input data which represents specific Command (action being processed over the entity by this service, i.e. CreateProductDTO, ChangeProductPriceDTO etc.) to the fieldset format, which would be processed and persisted by EntityManager (aka fieldsetManager). As a field set may contain different sets of fields dependent on use-case. EntityManager should link these fields with Entity Identity to make a persistence.