4 ms·
We have some APIs written with.NET Core and ASP.NET. They work pretty well but the number of dependency injections, overrides and options are starting to kill
by rqtwteye 2y ago
We have some APIs written with.NET Core and ASP.NET. They work pretty well but the number of dependency injections, overrides and options are starting to kill me. Basically you get the spaghetti code version of OO. Relevant behavior is spread out over many files and I find it really hard to figure out what's going on if I haven't written the code myself.
- cheschire 2y agoThat's because it's not really OOP. If you're struggling with using the latest .NET conventions, then perhaps you are still thinking in terms of deep inheritance, polymorphism, constructors, and rich object models. The modern ASP.NET focus on repositories, middleware, service factories, and moving context around in data transfer objects lends itself to a different architecture and arrangement of code that more closely mirrors the stateless needs of the web, where not only are the front end and back end separate applications, but the client is entirely untrustworthy. That's very different than the expectations when OOP was originally envisioned.
- rqtwteye 2y agoI don’t really care if it’s OOP by some definition or not. My point was that there are a lot of places where one can change the behavior of the app and it’s not easy to figure this out when you look at a codebase you don’t know yet.
- metaltyphoon 2y ago> My point was that there are a lot of places where one can change the behavior of the app Could you be more specific? As I’m aware, all you need to look for is where DI is being messed with.