neat-php / object

Neat Object components
MIT License
4 stars 1 forks source link

Plugins #4

Closed baukevdw closed 5 years ago

baukevdw commented 5 years ago

We need a way to change te repository behaviour in a clean way that doesn't grow the size of the repository class a lot.

Things we need to be able to do:

In short this changes the following repository behaviour:

baukevdw commented 5 years ago

Idea by @guidovanbiemen use decorators like the log component.

Create a repository interface. Create a repository implementation with just the default behaviour(default). Create a repository implemantation/trait that forwards all calls to the default repository(wrapper). Create decorators which extend/use the repository wrapper and extend or overwrite the behaviour.