<?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 for Critical Thought</title>
	<atom:link href="http://blog.endelo.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.endelo.com</link>
	<description>Effectively achieving things people actually care about</description>
	<lastBuildDate>Tue, 02 Mar 2010 19:00:27 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Singletons in PHP by John</title>
		<link>http://blog.endelo.com/2009/06/30/singletons-in-php/comment-page-1/#comment-33</link>
		<dc:creator>John</dc:creator>
		<pubDate>Tue, 02 Mar 2010 19:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=100#comment-33</guid>
		<description>Glad I could respond so quickly to you! Gerard might not be too pleased about my response time to him though :D. 

To address your statement, it&#039;s not so much about how unique each individual singleton is, but rather about the duplication of code used to simply implement the logic behind instantiating a singleton in the first place. Consider the concept of DRY as it applies to minimizing duplication of logic and, where possible, reducing boilerplate code. While you&#039;re database class will hold very different methods and fields than your session singleton, they both share the core logic of creating a single instance of themselves through a private constructor called by a static initializer: this is where abstraction and centralization of code would be most useful. 

Does that make sense? I enjoy conversations like these :)</description>
		<content:encoded><![CDATA[<p>Glad I could respond so quickly to you! Gerard might not be too pleased about my response time to him though <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-smile-big.png' alt=':D' class='wp-smiley' /> . </p>
<p>To address your statement, it&#8217;s not so much about how unique each individual singleton is, but rather about the duplication of code used to simply implement the logic behind instantiating a singleton in the first place. Consider the concept of DRY as it applies to minimizing duplication of logic and, where possible, reducing boilerplate code. While you&#8217;re database class will hold very different methods and fields than your session singleton, they both share the core logic of creating a single instance of themselves through a private constructor called by a static initializer: this is where abstraction and centralization of code would be most useful. </p>
<p>Does that make sense? I enjoy conversations like these <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Singletons in PHP by chris.</title>
		<link>http://blog.endelo.com/2009/06/30/singletons-in-php/comment-page-1/#comment-32</link>
		<dc:creator>chris.</dc:creator>
		<pubDate>Tue, 02 Mar 2010 13:56:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=100#comment-32</guid>
		<description>Thanks for the quick answer!

I actually use the Singleton classes for the Database connection, Logger, Debugger, Session manager and Current User. All those instances should be unique around the whole application so I guess this is &quot;ok&quot; ;-)
Any advice or comment on this ?</description>
		<content:encoded><![CDATA[<p>Thanks for the quick answer!</p>
<p>I actually use the Singleton classes for the Database connection, Logger, Debugger, Session manager and Current User. All those instances should be unique around the whole application so I guess this is &#8220;ok&#8221; <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-wink.png' alt=';-)' class='wp-smiley' /><br />
Any advice or comment on this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Singletons in PHP by John</title>
		<link>http://blog.endelo.com/2009/06/30/singletons-in-php/comment-page-1/#comment-31</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 01 Mar 2010 17:33:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=100#comment-31</guid>
		<description>@Gerard: Thanks, I appreciate it! True, it may not be a requirement for you, and it may even make things more difficult on you as a developer, but I can definitely rationalize the need to only ever allow one alias: at the very least, it would lessen calls to getInstance((), make it easier for threading (locking only one alias), reduce references (trivial amount of memory, I know ;) ), and maybe the most practical, clean up your code! :)

@Chris: Certainly, you can absolutely extract out your public methods in the DB_Connection class into an Interface, and yes, it would be helpful - for DB_Connection. However, that doesn&#039;t really get you any wins in regards to encapsulating the logic germane to the Singleton pattern itself (#__construct and #getInstance, and the $instance field). This was what I was talking about in that it rather sucks to have to re-implement this boilerplate code every time you need a Singleton. Now, that being said, hopefully you&#039;re not going to be using too many Singletons in your code anyway, but that&#039;s tangential :). Thanks for the comment!</description>
		<content:encoded><![CDATA[<p>@Gerard: Thanks, I appreciate it! True, it may not be a requirement for you, and it may even make things more difficult on you as a developer, but I can definitely rationalize the need to only ever allow one alias: at the very least, it would lessen calls to getInstance((), make it easier for threading (locking only one alias), reduce references (trivial amount of memory, I know <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-wink.png' alt=';)' class='wp-smiley' />  ), and maybe the most practical, clean up your code! <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
<p>@Chris: Certainly, you can absolutely extract out your public methods in the DB_Connection class into an Interface, and yes, it would be helpful &#8211; for DB_Connection. However, that doesn&#8217;t really get you any wins in regards to encapsulating the logic germane to the Singleton pattern itself (#__construct and #getInstance, and the $instance field). This was what I was talking about in that it rather sucks to have to re-implement this boilerplate code every time you need a Singleton. Now, that being said, hopefully you&#8217;re not going to be using too many Singletons in your code anyway, but that&#8217;s tangential <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> . Thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Singletons in PHP by chris.</title>
		<link>http://blog.endelo.com/2009/06/30/singletons-in-php/comment-page-1/#comment-30</link>
		<dc:creator>chris.</dc:creator>
		<pubDate>Mon, 01 Mar 2010 17:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=100#comment-30</guid>
		<description>Hi,

Couldn&#039;t we define an interface declaring connect and query methods to be used ? Might be useful sometimes</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Couldn&#8217;t we define an interface declaring connect and query methods to be used ? Might be useful sometimes</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Singletons in PHP by Gerard</title>
		<link>http://blog.endelo.com/2009/06/30/singletons-in-php/comment-page-1/#comment-22</link>
		<dc:creator>Gerard</dc:creator>
		<pubDate>Fri, 20 Nov 2009 05:50:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=100#comment-22</guid>
		<description>Good post, although I enjoyed the one on JavaScript caching more. I&#039;m not sure I agree with your statement that a purpose of Singletons is also to have only one alias; at least in Java, it&#039;s a common practice to have multiple declarations, as long as they reference the same object.

Either way, good post John. I&#039;ve already bookmarked this blog and sent you out to 20 of my programming friends. :)</description>
		<content:encoded><![CDATA[<p>Good post, although I enjoyed the one on JavaScript caching more. I&#8217;m not sure I agree with your statement that a purpose of Singletons is also to have only one alias; at least in Java, it&#8217;s a common practice to have multiple declarations, as long as they reference the same object.</p>
<p>Either way, good post John. I&#8217;ve already bookmarked this blog and sent you out to 20 of my programming friends. <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on $$: Cache, or Crash by Gerard</title>
		<link>http://blog.endelo.com/2009/05/27/cache-or-crash/comment-page-1/#comment-23</link>
		<dc:creator>Gerard</dc:creator>
		<pubDate>Wed, 18 Nov 2009 15:14:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=43#comment-23</guid>
		<description>Hah! Funny. I like you&#039;re writing style; great post. I work with Prototype extensively, and I&#039;m definitely implementing this on my next project.

Great article!</description>
		<content:encoded><![CDATA[<p>Hah! Funny. I like you&#8217;re writing style; great post. I work with Prototype extensively, and I&#8217;m definitely implementing this on my next project.</p>
<p>Great article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Frameworks: Tendency Towards Dependency by Gerard</title>
		<link>http://blog.endelo.com/2009/05/14/frameworks-tendency-towards-dependency/comment-page-1/#comment-24</link>
		<dc:creator>Gerard</dc:creator>
		<pubDate>Thu, 15 Oct 2009 18:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=7#comment-24</guid>
		<description>Oh wow. I could not agree more about the frameworks. I just found your blog, and this is one of the most solid technical assessments of 2009 coders I&#039;ve read to-date. I&#039;m a software engineer at American Express, and believe me, I know what you mean! We just finished adding a lot of dynamic JavaScript functionality to the user control panel, adding Ajax requests around payment submissions, and I had to implement Dojo across the application just so our engineers could work on it!

Anyway, this is a fantastic post. I&#039;m a first time visitor, and I&#039;m definitely going to be coming back! Thanks for the post!

-Gerard</description>
		<content:encoded><![CDATA[<p>Oh wow. I could not agree more about the frameworks. I just found your blog, and this is one of the most solid technical assessments of 2009 coders I&#8217;ve read to-date. I&#8217;m a software engineer at American Express, and believe me, I know what you mean! We just finished adding a lot of dynamic JavaScript functionality to the user control panel, adding Ajax requests around payment submissions, and I had to implement Dojo across the application just so our engineers could work on it!</p>
<p>Anyway, this is a fantastic post. I&#8217;m a first time visitor, and I&#8217;m definitely going to be coming back! Thanks for the post!</p>
<p>-Gerard</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Frameworks: Tendency Towards Dependency by AndrewBoldman</title>
		<link>http://blog.endelo.com/2009/05/14/frameworks-tendency-towards-dependency/comment-page-1/#comment-8</link>
		<dc:creator>AndrewBoldman</dc:creator>
		<pubDate>Fri, 05 Jun 2009 01:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=7#comment-8</guid>
		<description>Great post! Just wanted to let you know you have a new subscriber- me!</description>
		<content:encoded><![CDATA[<p>Great post! Just wanted to let you know you have a new subscriber- me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Frameworks: Tendency Towards Dependency by John</title>
		<link>http://blog.endelo.com/2009/05/14/frameworks-tendency-towards-dependency/comment-page-1/#comment-5</link>
		<dc:creator>John</dc:creator>
		<pubDate>Wed, 20 May 2009 06:37:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=7#comment-5</guid>
		<description>Ha, I&#039;m just not as dumb as you might remember :)</description>
		<content:encoded><![CDATA[<p>Ha, I&#8217;m just not as dumb as you might remember <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Frameworks: Tendency Towards Dependency by Caleigh</title>
		<link>http://blog.endelo.com/2009/05/14/frameworks-tendency-towards-dependency/comment-page-1/#comment-4</link>
		<dc:creator>Caleigh</dc:creator>
		<pubDate>Sat, 16 May 2009 05:51:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.endelo.com/?p=7#comment-4</guid>
		<description>You&#039;re just too smart for your own good. :)</description>
		<content:encoded><![CDATA[<p>You&#8217;re just too smart for your own good. <img src='http://blog.endelo.com/wp-content/plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
