<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Facade pattern in PHP	</title>
	<atom:link href="https://www.jakowicz.com/facade-pattern-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jakowicz.com/facade-pattern-in-php/</link>
	<description>Just another blogger</description>
	<lastBuildDate>
	Thu, 18 Apr 2024 15:33:53 +0000	</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.1.19</generator>
			<item>
				<title>
				By: Azer Qurbanov				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-6333</link>
		<dc:creator><![CDATA[Azer Qurbanov]]></dc:creator>
		<pubDate>Thu, 20 Sep 2018 19:11:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-6333</guid>
					<description><![CDATA[Hi, everythink is good. but what is a need to use SendMailInterface?]]></description>
		<content:encoded><![CDATA[<p>Hi, everythink is good. but what is a need to use SendMailInterface?</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Simon				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2962</link>
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sun, 18 Jun 2017 15:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2962</guid>
					<description><![CDATA[Hi Mohammad,

Firstly, thanks for the feedback, it&#039;s much appreciated, you have got a valid point. When I write blogs I try to follow the KISS principle, much like when writing code. The problem as you have rightfully pointed out, is that the facade pattern is used to simplify complicated code and my example doesn&#039;t demonstrate this fantastically. You said this 

&quot;SendMailFacade should be much cleaner&quot;

and the drawback I gave to this pattern was as follows

&quot;Although extremely useful the facade is often used when there is no need for it, this complicates your code needlessly.This isn’t a drawback as such, just be careful not to fall into this trap.&quot;

I think this is more the case. It&#039;s not that SendMailFacade is complicated, it&#039;s that SendMail isn&#039;t complicated enough to warrant a facade. The only parts that are being simplified are the send method and the ability to use method chaining.

In respect to laravel, which is my goto PHP framework right now and I know exactly what your saying. They use a lot of static facades but it&#039;s not standard and it brings about the case of hidden globals and they&#039;re not very testable, which both me less stable code. Laravel has a huge team and have got around the testing problem using Reflection, but it&#039;s not something I wouldn&#039;t encourage others to follow suit.]]></description>
		<content:encoded><![CDATA[<p>Hi Mohammad,</p>
<p>Firstly, thanks for the feedback, it&#8217;s much appreciated, you have got a valid point. When I write blogs I try to follow the KISS principle, much like when writing code. The problem as you have rightfully pointed out, is that the facade pattern is used to simplify complicated code and my example doesn&#8217;t demonstrate this fantastically. You said this </p>
<p>&#8220;SendMailFacade should be much cleaner&#8221;</p>
<p>and the drawback I gave to this pattern was as follows</p>
<p>&#8220;Although extremely useful the facade is often used when there is no need for it, this complicates your code needlessly.This isn’t a drawback as such, just be careful not to fall into this trap.&#8221;</p>
<p>I think this is more the case. It&#8217;s not that SendMailFacade is complicated, it&#8217;s that SendMail isn&#8217;t complicated enough to warrant a facade. The only parts that are being simplified are the send method and the ability to use method chaining.</p>
<p>In respect to laravel, which is my goto PHP framework right now and I know exactly what your saying. They use a lot of static facades but it&#8217;s not standard and it brings about the case of hidden globals and they&#8217;re not very testable, which both me less stable code. Laravel has a huge team and have got around the testing problem using Reflection, but it&#8217;s not something I wouldn&#8217;t encourage others to follow suit.</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: mohammad				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2956</link>
		<dc:creator><![CDATA[mohammad]]></dc:creator>
		<pubDate>Fri, 16 Jun 2017 09:36:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2956</guid>
					<description><![CDATA[Hello
SendMailFacade is a wrapper for the ugly sendMail class, yes it&#039;s, and it should be, because the pattern say so, but I knew facade most of the time as static class .
what you have done up there sir, is just a wrapper which takes the sendMail class in constructor which i know this type of taking as Constructor injection which implement sendMailInterface. and after that we return the same object on each method calling which I know it as Chain ability.
If you look at facade design patter in laravel, they have been implement this design pattern in a little wired and beutiful way. If i did not read the laravel documentation about facade i did not have any info of what Request facade will do for me .
what i mean, the class SendMailFacade should be much more cleaner because you said the facade is there to hide the most of the logic. I don&#039;t mean any thing with your example, please don&#039;t miss understand me. i&#039;m just saying a little bit of extracting or cleaning it makes the SendMailFacade looks better . I don&#039;t know maybe I&#039;m just saying that .]]></description>
		<content:encoded><![CDATA[<p>Hello<br />
SendMailFacade is a wrapper for the ugly sendMail class, yes it&#8217;s, and it should be, because the pattern say so, but I knew facade most of the time as static class .<br />
what you have done up there sir, is just a wrapper which takes the sendMail class in constructor which i know this type of taking as Constructor injection which implement sendMailInterface. and after that we return the same object on each method calling which I know it as Chain ability.<br />
If you look at facade design patter in laravel, they have been implement this design pattern in a little wired and beutiful way. If i did not read the laravel documentation about facade i did not have any info of what Request facade will do for me .<br />
what i mean, the class SendMailFacade should be much more cleaner because you said the facade is there to hide the most of the logic. I don&#8217;t mean any thing with your example, please don&#8217;t miss understand me. i&#8217;m just saying a little bit of extracting or cleaning it makes the SendMailFacade looks better . I don&#8217;t know maybe I&#8217;m just saying that .</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Simon				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2950</link>
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Wed, 14 Jun 2017 10:27:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2950</guid>
					<description><![CDATA[Gotta love those Avatars ;) Thanks, I&#039;m glad you find the blog useful. I&#039;ll get my writing hat back on soon. Finishing this design pattern series has been a long time coming.]]></description>
		<content:encoded><![CDATA[<p>Gotta love those Avatars 😉 Thanks, I&#8217;m glad you find the blog useful. I&#8217;ll get my writing hat back on soon. Finishing this design pattern series has been a long time coming.</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Danijela				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2936</link>
		<dc:creator><![CDATA[Danijela]]></dc:creator>
		<pubDate>Sun, 11 Jun 2017 17:53:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2936</guid>
					<description><![CDATA[haha avatars are hilarious :D :D :D]]></description>
		<content:encoded><![CDATA[<p>haha avatars are hilarious 😀 😀 😀</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Danijela				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2935</link>
		<dc:creator><![CDATA[Danijela]]></dc:creator>
		<pubDate>Sun, 11 Jun 2017 17:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2935</guid>
					<description><![CDATA[I&#039;m reading about patterns, and your examples are the best. Very simple, understandable, and I like your writing style. Keep writing :D]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m reading about patterns, and your examples are the best. Very simple, understandable, and I like your writing style. Keep writing 😀</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Simon				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2750</link>
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Thu, 06 Apr 2017 11:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2750</guid>
					<description><![CDATA[Hello :D]]></description>
		<content:encoded><![CDATA[<p>Hello 😀</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Dorajar				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2749</link>
		<dc:creator><![CDATA[Dorajar]]></dc:creator>
		<pubDate>Thu, 06 Apr 2017 02:01:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2749</guid>
					<description><![CDATA[hi!]]></description>
		<content:encoded><![CDATA[<p>hi!</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Simon				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2479</link>
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Wed, 16 Nov 2016 23:41:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2479</guid>
					<description><![CDATA[Thank you Tony. I&#039;m glad you find it useful.]]></description>
		<content:encoded><![CDATA[<p>Thank you Tony. I&#8217;m glad you find it useful.</p>
]]></content:encoded>
						</item>
						<item>
				<title>
				By: Simon				</title>
				<link>https://www.jakowicz.com/facade-pattern-in-php/#comment-2478</link>
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Wed, 16 Nov 2016 23:40:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.jakowicz.com/?p=926#comment-2478</guid>
					<description><![CDATA[Glad you worked it out, I guess you just glazed over line 121? I haven&#039;t made any video content yet. I would recommend checking out the video content on Laracasts. They only cover about 5 videos on design patterns, but the guys content is usually top notch.]]></description>
		<content:encoded><![CDATA[<p>Glad you worked it out, I guess you just glazed over line 121? I haven&#8217;t made any video content yet. I would recommend checking out the video content on Laracasts. They only cover about 5 videos on design patterns, but the guys content is usually top notch.</p>
]]></content:encoded>
						</item>
			</channel>
</rss>
