-
Notifications
You must be signed in to change notification settings - Fork 39
Terminology #38
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
Comments
Not sure, I believe the interfaces What different interface would you suggest? |
Actually, I would like to preserve the two separated interfaces. They are fine. My particular idea is to rename the adapter to something which just could be used as a client itself. For example Guzzle 7 could implement what we call Adapter interface (and the Client interface as well). From this point, the adapter is not an adapter anymore, but the client itself. So maybe we could call these things |
Good idea! Although I don't know if adoption is high enough and whether enough http client maintainers know about this interface. |
The point is that we make it possible. Also, if this interface gets to a PSR once, we don't have to change our entire architecture....better do it now. |
The two interfaces are good enough IMO. We just need proper naming. Also, I am thinking about to put the interfaces into one package. This also solves the exception problem I am struggling with: currently the adapter and the client interface have separate exceptions which does not make much sense IMO. They serve the same purpose. |
I agree. Also on the same package for both interfaces. And where would the client implementation go? |
Which client implementation? This one? Currently I only have an imaginary state in my mind (as I explained it here), but I don't really have an exact implementation/naming strategy (yet). @ddeboer can you also join the discussion? You've already used the adapter, I am curious about your points on this. |
Yes. php-http/adapter, php-http/adapter-client and php-http/client could be one repository imho. Btw I'm doing a talk at Laracon EU in 2 weeks where I will mention php-http. |
Well, I think interfaces should go into one package, implementation into
In these cases implementation is not needed at all. Also, I am thinking about adding a third interface which extends both |
Agreed. Like what? Likes this: namespace Http\Client;
interface PsrHttpClient
{
...
} namespace Http\Client;
interface HttpClient
{
...
} namespace Http\Client;
interface Client extends PsrHttpClient, HttpClient
{
} I would actually work on
In that order. Because waiting on the FIG to for an approved version... It could be useful to make something that is already greatly adopted so they will consider using great portions (if not all) of this HTTP adapter interface for their interface. |
Actually I would prefer if Client would extend HttpClient and My plan is to merge the client and the adapter package. But we should |
imho from a user point of view, i don't care whether i use an adapter to some non php-http complient client or a client directly. so a big +1 on merging those. if an adapter needs additional methods for the configuration or such, this is an implementation detail for adapter builders but client libraries that just consume the http client should not need to care about this. |
Let's continue discussion in #40 |
I am thinking about the following:
We could make adapter/client a set of interfaces which are recommended for client implementations. This way if an HTTP Client PSR is created once, we already have something.
The adapter naming is useful in the context of creating adapters wrapping clients. But for the long term, clients themselves should have a common interface which makes the adapter naming a bit vague.
I remember @jeromegamez mentioned something similar.
What do you think?
The text was updated successfully, but these errors were encountered: