Different ways to create a middleware

Some of those might work with Katana only???