The current decorator pattern has some issues. To cope with these issues 2 additional elements will be added.
The first one is the query builder. Instead of modifying queries by passing them through decorators and overriding all methods we could provide the Repository with an immutable query builder that can be used for all methods. Before initialization the query builder can be passed through a set of modifiers to for example filter out the soft deleted records or set a default order.
The second element is a store handler. This is meant to replace the soft deletes, created and updated timestamps. The store handler should be able to modify an entity and change the behavior.
Requirements:
The current decorator pattern has some issues. To cope with these issues 2 additional elements will be added.
The first one is the query builder. Instead of modifying queries by passing them through decorators and overriding all methods we could provide the Repository with an immutable query builder that can be used for all methods. Before initialization the query builder can be passed through a set of modifiers to for example filter out the soft deleted records or set a default order.
The second element is a store handler. This is meant to replace the soft deletes, created and updated timestamps. The store handler should be able to modify an entity and change the behavior. Requirements: