Hacker News new | past | comments | ask | show | jobs | submit login

Yes, assembly loading is exactly what I'm talking about.

>An assembly is loaded the first time it is referenced in executing code in an AppDomain. This is fairly unavoidable in the .NET world

Premature assembly loading was easily avoidable with Web.config where you specified the request filter and assembly qualified type name of a handler. Hope it will be covered in ASP.NET Core / OWIN someday.

Yes, you are right about the map: it allows you to select who handles what. Still Web.config stays a much better contender in that deep matter: it allows to attach modules without changing code. A common scenario like adding a custom auth module to existing web application is a breeze with Web.config.

Code-based map looks a bit clunky after experiencing the gifts of Web.config flexibility and efficiency.




The exact problem with Web.config modules is that they are never handled in your code, only in the config. It also is very IIS-specific, precluding it from working easily with other web servers cross-platform. With OWIN, by starting with code, there is nothing stopping you or someone else from making a config-file-driven middleware loader to accomplish the functionality you're looking for. i.e. app.LoadMiddlewareFromConfig("middleware.json")


The only thing that precludes Web.config from working cross-platform is the absence of reliable implementation of a cross-platform web server. For example, I don't even consider Nginx reliable on Windows; some nasty effects are in place. The best home for Nginx is Linux. The best home for IIS is Windows. Cross-platform sounds sweet in theory but in reality it goes down hill pretty fast with subtle defects.


What's stopping you from using IIS on Windows and Nginx on Linux? It's not like you're committing to one server for one application.


Hmm, fair. I personally prefer the Owin approach, since it allows for a lot more customization/configuration options, but I see your point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: