Skip to content

Extract plugin interface and logger/cache plugins #63

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

Closed
sagikazarmark opened this issue Mar 1, 2016 · 7 comments
Closed

Extract plugin interface and logger/cache plugins #63

sagikazarmark opened this issue Mar 1, 2016 · 7 comments

Comments

@sagikazarmark
Copy link
Member

As mentioned in #61

@Nyholm
Copy link
Member

Nyholm commented Mar 1, 2016

I think this is a good idea. But we should be careful not to over engineer our package design. The more packages you have the more maintenance you will get.

At the moment there is quite a few issues (#56, #57, #58, #59) that will add complexity to the cache plugin. So it might be worth considering moving the cache plugin to a different package.

@sagikazarmark
Copy link
Member Author

Our current setup makes it quite hard to create separate/custom plugins without tons of dependencies.

So what we should/could do:

  • Extract the plugin interface: since it is an interface package, it does not require too much maintenance
  • Extract the plugin client: it allows to use any plugins without ours
  • Have the current plugin collection as is with plugin and plugin-client as dependencies to preserve BC

Optionally: extract any plugins with external dependencies. This one is a bit harder, as we either cannot make hard dependencies in the already existing plugins, or they will kind of conflict with the current plugins package.

@dbu
Copy link
Contributor

dbu commented Mar 2, 2016 via email

@joelwurtz
Copy link
Member

👎 on this, we currently have too many packages IMO and don't want to separate this even more.

I'm more on moving complex plugins into their own repository like @dbu said on the cache one.

On the contrary i would be more in favor on merging the plugin package with the common-client package, (for me PluginClient is a common client)

So that in fact we have the following packages :

  • HTTPlug : interfaces for sending requests
  • Message : Implementation, tools and other things about PSR7
  • CommonClient (or another name) : Implementation, tools and other things about HTTPlug interface
  • A package for each client / adapters

@sagikazarmark
Copy link
Member Author

Moving the PluginClient to client-common sounds an interesting idea.

How would the dependency look like in that case:

  • Require the plugins package in client-common?
  • Require client-common in plugins (which is the case actually right now)?
  • Second option+moving the plugin interface as well?

Keeping PluginClient and Plugin interface together is a good idea, I just wrote it for the sake of completeness.

Another upside of this idea: Creating separate plugin packages becomes a little bit cleaner this way IMO. The plugin implementations require a few dependencies, while client-common only require two small ones.

So my vote goes two option three from the list above.

@sagikazarmark
Copy link
Member Author

See php-http/client-common#14 and #64

@dbu
Copy link
Contributor

dbu commented Mar 29, 2016

i can agree with the 2 pull requests. i am not sure if we gain anything by it, but it is also not worse.

we need to keep the doc in sync here as well, e.g. the description of what the plugin repo provides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants