php-http / message-factory

Abandoned: Httplug Factory interfaces for PSR-7 HTTP Message
http://php-http.org
MIT License
1.38k stars 10 forks source link

Remove ClientContextFactory #10

Closed sagikazarmark closed 8 years ago

mekras commented 8 years ago

I'd like to keep this interface. Actually I've already planned to use it to minimize injected dependency count.

mekras commented 8 years ago

I changed my mind :smile: I better implement it in my project by myself.

sagikazarmark commented 8 years ago

Actually it violates a few SOLID principles. Also, these factories are implemented on their own (MessageFactory, StreamFactory, etc). How would you implement them in one class? Multiple inheritance is missing from PHP, traits are kind of replacement, but do not provide real solution (implementing factories as traits is not a good idea). If you can provide any viable use case, then I would reconsider removing it, but right now, I don't see the added value of this interface (actually, quite the opposite).

dbu commented 8 years ago

if we see the need for something like this, we better have a concrete class that aggregates the 3 interfaces and forwards the methods. the use case of reducing the number of dependencies seems ok to me - if a class needs factories for all 3 things. but lets remove the interface for now, yes.

mekras commented 8 years ago

@sagikazarmark, that's why I changed my mind, just couldn't put it into English words.

sagikazarmark commented 8 years ago

Cool. :+1: The important thing is we understood each other at the end. :smile: