New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Owin terms #20
Comments
If we split the specs, as we have proposed doing, I think your term changes make sense. We could focus the primary OWIN spec on separation of server and handler. Our middleware spec could then dictate application-level semantics on the handler side. What do you think? |
Sounds wise and an important step forward... |
I'd like to make a case for keeping the application/middleware distinction. I'm currently in soft 404 hell with a Web API application returning a 404 but an Owin host returning a 200. In my opinion, part of the problem is that there is not a clear distinction between what is middleware and what is an application. Middleware components have the basic property of passing a request on by default. Under certain cases, they may intercept the request and return a response directly. In my opinion, application components should be responsible for completely satisfying all requests passed to them, whether the result has a successful or unsuccessful status code. Middleware routing components should be used to ensure that applications receive the requests that are intended for them. Calling everything a handler encourages this strange model of an application that determines that it isn't responsible for that a particular URI and so passes it on to another application. However, there is no standardized way of communicating this desire and so we have implementations like Katana that have created soft 404s to deal with it. |
I think we need to reconsider the spec scope before discussing what to keep or remove which is basically what I’m arguing for. I think that at its core the distinction between application and middleware (or both) is irrelevant to the spec.
I certainly don't want to change the discussion to a REST discussion... My intent with the quote was to simply show how the term "handler" was intuitively used as figure of speech for where actual request processing occurs in an established architecture. Nevertheless, I don't quite understand what conclusion are you drawing here from intermediaries/origin server and what inherent architectural qualities do middleware poses as opposed to handlers in the general scenes? (not ASP.NET handlers)
So could those termed "handlers", they just don't suggest being in the "middle" of anything.
What exactly is the take for OWIN as a gluing API?
The way I see it, the "application" is a collection of handler implementations (e.g "Middleware components"). The server, well is just a server be it iis, httplistener or some other socket based implementation. "Routing" is an app/framework specific concept.
p.s Markdown rocks! |
Coming to think of it, might be a good idea to consult with IIS/ASP.NET folks on chaining aspects as they must have faced these types of concerns when designing the pipline.. may very well turn out to be a problem not worth dealing with. |
Thank you for this dialogue. I think it highlights the different concerns we need to address and why, imho, one spec is insufficient to clarify all points. OWIN started as a mechanical abstraction between servers/hosts and handlers/applications. For those confused by the term host, as I was up to a few days ago, a host is essentially a server adapter that allows running specific types of handlers, e.g. mod_mono running on an Apache web server. The mechanical abstraction is defined by the Middleware as intermediaries is an architectural abstraction. I think this equally important, especially from the perspective of interop between OWIN implementations and in setting the context for discussions such as whether shared state should or could be allowed across middleware components. The signature we agreed on, and which still needs a spec, is defined as: using Env = IDictionary<string, obj>;
using AppFunc = Func<Env, Task>;
using MidFunc = Func<AppFunc, AppFunc>; The Lastly, we've discussed a Do these breakouts resonate with anyone else? Is this a pattern we should follow in further defining and refining specs? @markrendle is planning to commence writing the middleware spec soon, so I think it would help to answer a few questions:
|
So this would essentially restrict the OWIN mechanical spec to describing AppFunc and the Environment dictionary, standard keys and so forth (effectively a Host spec, in fact), and introduce a new spec describing the way in which an AppFunc is built by combining middlewares and applications? I guess it makes sense, it would keep the two documents more concise and relevant to different audiences. I think Web Sockets would necessarily remain part of the Host spec, since it prescribes how the Host should provide the Web Socket upgrade delegate. |
Exactly! It’s an implementation requirement on existing servers to “speak OWIN” but now consider new OWIN servers implementations, these wouldn’t need any adapter as OWIN would be their “mother tongue”. My point being, that the spec should state what API is required to be compliant and no more. Here is the difference in terms of block diagrams: Existing Server: [IIS Server] [OWIN Server Adapter] [Handler] New Server: [OWIN Speedy Server] [Handler] IMHO, OWIN at it's core/mechanical abstraction should simply be about Servers and Handlers which will make simple questions easy to answer like: does your server support OWIN? Is your server OWIN complaint ? I can envision big potential for new OWIN Servers.. Indecently I did some research on java-based nio servers and found them popping out like mushrooms using custom memory allocators leaving the GC to take a backseat. OWIN can be a catalyst for such trend in .NET |
Itaid
That is pretty much all I was trying to say. I just tend to be verbose when frustrated :-). That distinction is made by HTTP architecture and therefore I see value in making that distinction in the Owin spec. Whether it ends up being in one spec or two doesn't really concern me too much. My reason for mentioning the soft 404 issue was to highlight the fact that because Owin doesn't currently clearly distinguish these two notions, we have implementations that use "terminating" style handlers to sometimes do passthrough to other "terminating" handlers. Personally I find this a confusing approach. However, this really is a Web API issue, not an Owin issue. |
+1 to this. If you remember, the soft 404 question was so painful that I left this group about it back in the days. :)) |
Closing this in favor of #24, which moves us closer to a resolution. |
I'm a bit confused with the various Owin terms (e.g Web Framework, Web Application, Application)
Why not just state:
"OWIN defines a standard interface between .NET http servers and http handlers."
Whether a specific http handler implementation ultimately defines a framework or some simple processing routine seems like a different concern and orthogonal to the spec.
I mean why include application type semantics in a general interface?
Furthermore, I think the term “handler” is more straightforward than “middleware” as it clearly conveys the notion of responsibility and the general idea has been well established by ASP.NET ... I think the term OwinHandler/OwinHttpHandler is better.
You can even see such use in roy’s dissertation.
http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf
Page 133: "The resource is not the storage object. The resource is not a mechanism that the server uses to handle the storage object. The resource is a conceptual mapping — the server receives the identifier (which identifies the mapping) and applies it to its current mapping implementation (usually a combination of collection-specific deep tree traversal and/or hash tables) to find the currently responsible handler implementation and the handler implementation then selects the appropriate action+response based on the request content. All of these implementation-specific issues are hidden behind the Web interface"
As far as other definitions:
I think the attempt to convey the flow of information in definitions is to much for the reader to digest and results in wording like “owin semantics” which are not straightforward, definitely at that stage in the document.
I suggest keeping it simple like:
Then I would add something like:
This specification aims to define a standard API by which a Server component communicates with Handler component and vice versa.
I also suggest removing the Host definition as I don’t see how it contributes to the clarity of the spec. If we accept the use of the term “component” than it’s pretty clear that the context here is a computer process and avoid any ambiguity with the “Host” term in its most common use (e.g server / machine)
The text was updated successfully, but these errors were encountered: