With your suggestion the response object wouldnt have any responsibility and the kernel would manage everything which is not a good OO design.
With another example: Fabien (kernel) gives (handle) a letter (request) to the postman (response) and the postman will deliver (send) it where it is addressed. Bur it is not about how you write your code and how clear that is. In your example the response sending depends on the kernel but it shouldnt, the response should know how to send itself. Back to the real life example, Fabien doesn't know how to deliver a message, how to find the place by postcode, how to go there etc, indeed he doesnt want to know about it, the postman should know about it. I hope what I'm saying makes sense for you. Agoston Fung On 28 Nov 2010, at 12:53, Jordi Boggiano <[email protected]> wrote: > On Sat, Nov 27, 2010 at 4:36 PM, Lukas Kahwe Smith <[email protected]> > wrote: >>> Now, translate this example with the HttpKernel component: >>> >>> Actual code: >>> $kernel = new AppKernel('prod', false); >>> $kernel->handle(new Request())->send(); >>> >>> Future code: >>> $kernel = new AppKernel('prod', false); >>> $response = $kernel->handle(new Request()); >>> $kernel->send($response); >> >> >> just looking at the two above versions i agree i like the second one better. > > I have to disagree here. You don't need a Kernel to send a response. > The last line could be $response->send() and still it'd be clear. The > clarity comes from expanding it in 3 lines imo, not from the fact that > the Kernel has a send() method added. > > Cheers > > -- > Jordi Boggiano > @seldaek :: http://seld.be/ > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/symfony-devs?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
