2026-09-21 21:22 UTC
Is there a pattern/name for a concept of a "lens" or "specification" pre-applied to a persistence repository?
Thinking, roughly:
```php
interface SuperSecretStuffRepository {
function find(SomeId): VeryImportant;
}
interface FilterForUser {
function apply(User, SuperSecretStuffRepository): SuperSecretStuffRepository;
}
```
It certainly is some sort of decorator.
Pseudo-code is #php
Replies (1)
-
@Girgias@phpc.social 2026-09-22 00:15
@ocramius@mastodon.social Lenses are a concept in category theory, but I'm very unsure if that's what you are actually looking for.