http-interop / http-middleware

PSR-15 interfaces for HTTP Middleware
MIT License
73 stars 7 forks source link

Move method definitions to root interface #10

Closed DaGhostman closed 8 years ago

DaGhostman commented 8 years ago

I was looking through the interfaces and noticed that MiddlewareInterface does not define any methods, but ClientMiddlewareInterface and ServerMiddlewareInterface define the same method, wouldn't it be better if the signature is defined within the base interface rather than in each extending interface?

Seems like it will make more sense for MiddlewareInterface to provide the method signatures while every other, that extends it could define additional methods if any. Also, if no additional methods are provided they can be used by implementations as meta interfaces to enforce the contracts as to which middleware is supposed to work on what stack (client/server).

mindplay-dk commented 8 years ago

wouldn't it be better if the signature is defined within the base interface rather than in each extending interface?

How?

shadowhand commented 8 years ago

@DaGhostman this has been discussed at length on the ML. The bottom line is that server middleware needs to use ServerRequest which would make it incompatible with a base process() method.