DEV Community

loading...

Discussion on: Introducing Gate Classes (Design Pattern)

Collapse
atechiethought profile image
atechiethought

This is quite similar to what Guard class in many open source projects has been used for. Moreover, fluentvalidations lib provides many other features. You or readers might be interested to take a look.

Collapse
jamesmh profile image
James Hickey Author

Yes. If people are getting into a CQRS or use case style architecture, then using Mediatr is a fantastic tool.

You can register pre-processor handlers that run before each handler. These gate classes I'm discussing can easily be converted as a pre-processor handler (that's essentially the same pattern).