I think an important part of Single Responsibility Principle which is being 
forgotten is, group things that change for the same reason. 

It's my understanding that you have one responsibility creating a stream, 
it's suggested that instead of having a single factory that creates 
multiple kinds of streams, you have multiple different factories. This 
would mean if I change how a stream is created I would have to then edit 
multiple factories. This would breach Single Responsibility Principle. Also 
the fact we only have one responsibility - creating streams would lead us 
to the fact that we only need one factory. 

If anything it would be a case of having a single highly flexible interface 
and each of "MemoryStreamFactoryInterface", 
"CallbackStreamFactoryInterface", "ResourceStreamFactoryInterface", would 
actually just be classes that implement the factory interface. Since each 
of them are actually implementations of a factory.

Iain

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/7862318c-2e0d-461a-9fab-42864cb4283c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to