<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: The Issues With Singletons and How to Fix Them	</title>
	<atom:link href="https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Sun, 18 Mar 2018 19:50:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: Jonathan Boccara		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-874</link>

		<dc:creator><![CDATA[Jonathan Boccara]]></dc:creator>
		<pubDate>Sun, 18 Mar 2018 19:50:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-874</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-846&quot;&gt;shaik shami&lt;/a&gt;.

Shaik, just in case you weren&#039;t notified, note that Mihai answered your comment &lt;a&gt;here&lt;/a&gt;. Thanks!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-846">shaik shami</a>.</p>
<p>Shaik, just in case you weren&#8217;t notified, note that Mihai answered your comment <a>here</a>. Thanks!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mihai Sebea		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-871</link>

		<dc:creator><![CDATA[Mihai Sebea]]></dc:creator>
		<pubDate>Sat, 17 Mar 2018 17:56:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-871</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-869&quot;&gt;f_zweig&lt;/a&gt;.

Well the game class here is just an example of the point that I was trying to make: that some classes should not know about each other and some other  class ie the game can connect them ... It s not meant as a production ready class. I suppose if you would want to test the game class you would have a factory method that would create what ever classes are needed to be mocked]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-869">f_zweig</a>.</p>
<p>Well the game class here is just an example of the point that I was trying to make: that some classes should not know about each other and some other  class ie the game can connect them &#8230; It s not meant as a production ready class. I suppose if you would want to test the game class you would have a factory method that would create what ever classes are needed to be mocked</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: f_zweig		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-869</link>

		<dc:creator><![CDATA[f_zweig]]></dc:creator>
		<pubDate>Fri, 16 Mar 2018 20:37:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-869</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-868&quot;&gt;Mihai Sebea&lt;/a&gt;.

How would you create an instance of the Game class with mock logger, mock debugger and/or mock profiler? You can&#039;t, because they are part of the class and cannot be set/replaced from outside.

Or am I missing something fundamental here?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-868">Mihai Sebea</a>.</p>
<p>How would you create an instance of the Game class with mock logger, mock debugger and/or mock profiler? You can&#8217;t, because they are part of the class and cannot be set/replaced from outside.</p>
<p>Or am I missing something fundamental here?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mihai Sebea		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-868</link>

		<dc:creator><![CDATA[Mihai Sebea]]></dc:creator>
		<pubDate>Fri, 16 Mar 2018 19:58:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-868</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-866&quot;&gt;f_zweig&lt;/a&gt;.

What can of problem would you have with mock objects ?
The problem that i see in passing objects in the constructor is that in introduces too much coupling !]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-866">f_zweig</a>.</p>
<p>What can of problem would you have with mock objects ?<br />
The problem that i see in passing objects in the constructor is that in introduces too much coupling !</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: f_zweig		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-866</link>

		<dc:creator><![CDATA[f_zweig]]></dc:creator>
		<pubDate>Fri, 16 Mar 2018 10:14:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-866</guid>

					<description><![CDATA[Speaking of testing, I feel like the third solution will have issues when trying to replace the logger, debugger, or profiler with mock objects. In the second approach, I can just pass mock instances through the constructor. There&#039;s no way to do that in the third approach.

So I think the best would be to combine those two, and have the objects to which you want to connect passed via constructor (c.f. dependency injection).]]></description>
			<content:encoded><![CDATA[<p>Speaking of testing, I feel like the third solution will have issues when trying to replace the logger, debugger, or profiler with mock objects. In the second approach, I can just pass mock instances through the constructor. There&#8217;s no way to do that in the third approach.</p>
<p>So I think the best would be to combine those two, and have the objects to which you want to connect passed via constructor (c.f. dependency injection).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Антон		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-861</link>

		<dc:creator><![CDATA[Антон]]></dc:creator>
		<pubDate>Thu, 15 Mar 2018 13:38:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-861</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-847&quot;&gt;Mihai Sebea&lt;/a&gt;.

In such a &#039;cross-dependency&#039; case it doesn&#039;t matter whether logger and filesystem are singletons or not. You have to solve the dependency first and then you&#039;ll find singletons are still fine!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-847">Mihai Sebea</a>.</p>
<p>In such a &#8216;cross-dependency&#8217; case it doesn&#8217;t matter whether logger and filesystem are singletons or not. You have to solve the dependency first and then you&#8217;ll find singletons are still fine!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Gil		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-853</link>

		<dc:creator><![CDATA[Gil]]></dc:creator>
		<pubDate>Fri, 09 Mar 2018 11:16:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-853</guid>

					<description><![CDATA[Here is a great talk about global state and singletons from google: 
https://www.youtube.com/watch?v=-FRm3VPhseI
Basically, you very rarely need a true Singleton, more often you just need a *single instance* of some class (which you can pass around without actually restricting instantiation).]]></description>
			<content:encoded><![CDATA[<p>Here is a great talk about global state and singletons from google:<br />
<a href="https://www.youtube.com/watch?v=-FRm3VPhseI" rel="nofollow ugc">https://www.youtube.com/watch?v=-FRm3VPhseI</a><br />
Basically, you very rarely need a true Singleton, more often you just need a *single instance* of some class (which you can pass around without actually restricting instantiation).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mihai Sebea		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-847</link>

		<dc:creator><![CDATA[Mihai Sebea]]></dc:creator>
		<pubDate>Thu, 08 Mar 2018 20:54:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-847</guid>

					<description><![CDATA[Hi 
what I was trying to say is that it might be ok if you had ONLY one system as a singleton ... like the logger ..or the filesystem. What happens in practice is that you have multiple systems as singletons . You will have the logger , the filesystem, the keyboard the display and probably many others.   And by they will depend on each other I mean that the logger class might need access to the filesystem in order to log to a file but the filesystem might need the logger to log when a file is opened. 
I hope this explains this a bit better !]]></description>
			<content:encoded><![CDATA[<p>Hi<br />
what I was trying to say is that it might be ok if you had ONLY one system as a singleton &#8230; like the logger ..or the filesystem. What happens in practice is that you have multiple systems as singletons . You will have the logger , the filesystem, the keyboard the display and probably many others.   And by they will depend on each other I mean that the logger class might need access to the filesystem in order to log to a file but the filesystem might need the logger to log when a file is opened.<br />
I hope this explains this a bit better !</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: shaik shami		</title>
		<link>https://www.fluentcpp.com/2018/03/06/issues-singletons-signals/#comment-846</link>

		<dc:creator><![CDATA[shaik shami]]></dc:creator>
		<pubDate>Thu, 08 Mar 2018 18:08:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=3249#comment-846</guid>

					<description><![CDATA[Hello,

I didn&#039;t get the context 
&quot;But in my experience you never have just one system as a singleton. You have multiple occurrences of them and at some point they will depend on each other.&quot;
Could you please explain in-detail ?]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>I didn&#8217;t get the context<br />
&#8220;But in my experience you never have just one system as a singleton. You have multiple occurrences of them and at some point they will depend on each other.&#8221;<br />
Could you please explain in-detail ?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
