-
Notifications
You must be signed in to change notification settings - Fork 60
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
Refactor the whole project #69
Comments
This library could be useful to us and we also have the need to customize the generation replace services. However, the way you're describing it sounds more like service locator pattern, which is more commonly considered an anti-pattern. In my understanding, in pure dependency injection, you would inject the services (usually as constructor parameters), not the service provider. Using the service provider makes it more like service locator. The main drawback of service locator is that it's hard to figure out what other services a class depends on. So if Operation handler depends on Path hander, then it's much more obvious if Operation handler receives IODataOpenApiPathHandler as constructor parameter. Then there can be a separate "activator" or "factory" class which constructs the services, possibly making use of the dependency injection library and service provider. |
In general, making substantial breaking changes to the API surface of a library makes it less useful to Microsoft product teams consuming it, who simply can't rewrite their code to consume new, disruptive changes. This simply stops us from consuming the new version and leaves us stuck on legacy versions. Unless there is overwhelming new value, we should take the hit that the API surface which exists when a library becomes popular is the API surface for the forseeable future. The idea that the existence of major versions means it's OK to regularly make breaking change is a fallacy as a consumer. |
Short summary (3-5 sentences) describing the issue.
Recently, I got a lot of requirements, for example
Yes, we can meet all of these by modifying the codes, by adding settings, etc.
However, i'd think maybe it's time to refactor it in the next major release.
Design
I'd like to use the Dependency Injection to allow customer to customize the converting process.
We need figure out the working flow from OData to OpenAPI. The process steps are certain, at each step, we can create a service to work on it.
Services
We need figure out the services used during converting.
for example:
Extension methods
I think we need
Usage
Advantage
It can be used in the ASP.NET Core pipeline, for example we can create a middleware to generate the OpenAPI description for a OData service.
It can support to customize the converting. For example, we can replace a certain service using customized service.
The text was updated successfully, but these errors were encountered: