2 ms·
But not having enough abstraction is also problematic and Go does cross that line for me at least. Eg. on my current CRUD app, we use Spring’s aspects to imple
by kaba0 5y ago
But not having enough abstraction is also problematic and Go does cross that line for me at least.
Eg. on my current CRUD app, we use Spring’s aspects to implement some permission checking before specific HTTP requests. The alternative - copying a function call to each place - would be much more bug prone, a change in one will not be propagated, etc.
While it may not be the best example, there are many similar cases where I feel that less abstraction would just make it unmaintainable.
- pphysch 5y agoNo need to embed function calls everywhere. The integration of authorization middleware should only be as complicated as your routing: mux.Handle("/", middlewareOne(middlewareTwo(finalHandler))) https://www.alexedwards.net/blog/making-and-using-middleware https://www.alexedwards.net/blog/making-and-using-middleware