Apidesign: /* Hubert said ... */ - 2013-10-28 10:50:17

Hubert said ...

←Older revision Revision as of 10:50, 28 October 2013
Line 17: Line 17:
--Viky 08:29, 22 October 2013 (CEST)
--Viky 08:29, 22 October 2013 (CEST)
-
</div>
 
-
== Hubert said ... ==
 
-
 
-
<div class='commentBlock'>
 
-
Type your comment Allowed HTML: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong> For suit smlobys put a ! in front of the letter for the suit in caps (e.g. !S for the spade symbol). Wordpress Hashcash needs javascript to work, but your browser has javascript disabled. Your comment will be deleted!
 
-
 
-
--Hubert 14:50, 23 October 2013 (CEST)
 
</div>
</div>

188.143.232.12: Comment provided by Hubert - via ArticleComments extension - 2013-10-23 12:50:24

Comment provided by Hubert - via ArticleComments extension

←Older revision Revision as of 12:50, 23 October 2013
Line 17: Line 17:
--Viky 08:29, 22 October 2013 (CEST)
--Viky 08:29, 22 October 2013 (CEST)
 +
</div>
 +
== Hubert said ... ==
 +
 +
<div class='commentBlock'>
 +
Type your comment Allowed HTML: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong> For suit smlobys put a ! in front of the letter for the suit in caps (e.g. !S for the spade symbol). Wordpress Hashcash needs javascript to work, but your browser has javascript disabled. Your comment will be deleted!
 +
 +
--Hubert 14:50, 23 October 2013 (CEST)
</div>
</div>

188.143.232.12: Comment provided by Viky - via ArticleComments extension - 2013-10-22 06:29:25

Comment provided by Viky - via ArticleComments extension

←Older revision Revision as of 06:29, 22 October 2013
Line 11: Line 11:
--[[User:JaroslavTulach|JaroslavTulach]] 12:08, 18 March 2010 (UTC)
--[[User:JaroslavTulach|JaroslavTulach]] 12:08, 18 March 2010 (UTC)
 +
== Viky said ... ==
 +
 +
<div class='commentBlock'>
 +
Using singletons as glablos is just plain wrong and on top of that inefficient. If you use a pure global the assembly doesn't have to check every time if the static has been initialised. I once read an interesting article by Herb Sutter in CUJ on "singleton pattern abuse". Unfortunately game programmers (not all of them) including me often can't be bothered to design software beyond their nose and establish clear ownership rules so glablos, pardon, singletons will be around for some time.
 +
 +
--Viky 08:29, 22 October 2013 (CEST)
 +
</div>

JaroslavTulach at 12:08, 18 March 2010 - 2010-03-18 12:08:11

←Older revision Revision as of 12:08, 18 March 2010
Line 7: Line 7:
--Andrei Badea 11:52, 12 February 2010 (CET)
--Andrei Badea 11:52, 12 February 2010 (CET)
</div>
</div>
 +
 +
Simple answer is that Lookup.getDefault() is in fact a "meta-singleton", so you can have a testing implementation that will allow you to do what you want. I am still looking for more complex answer that would use ''mockito''.
 +
 +
--[[User:JaroslavTulach|JaroslavTulach]] 12:08, 18 March 2010 (UTC)

192.9.112.196: /* Andrei Badea said ... */ - 2010-02-12 10:53:52

Andrei Badea said ...

←Older revision Revision as of 10:53, 12 February 2010
Line 3: Line 3:
<div class='commentBlock'>
<div class='commentBlock'>
-
Often the MockDialogDisplayer used in tests will be configurable. For example, it may have a constructor taking a parameter that says whether the yesOrNo() method returns true or false. So in a test I create an instance of MockDialogDisplayer, as opposed to letting ServiceLoader or the Lookup library to create it. When I hold such an instance, how do I set it as the singleton instance?
+
Often the MockDialogDisplayer used in tests will be configurable. For example, it may have a constructor taking a parameter that says whether the yesOrNo() method returns true or false. So in a test I create an instance of MockDialogDisplayer, as opposed to letting ServiceLoader or the Lookup library create it. When I hold such an instance, how do I set it as the singleton instance?
--Andrei Badea 11:52, 12 February 2010 (CET)
--Andrei Badea 11:52, 12 February 2010 (CET)
</div>
</div>

192.9.112.196: Comment provided by Andrei Badea - via ArticleComments extension - 2010-02-12 10:52:14

Comment provided by Andrei Badea - via ArticleComments extension

←Older revision Revision as of 10:52, 12 February 2010
Line 1: Line 1:
Questions?
Questions?
 +
== Andrei Badea said ... ==
 +
 +
<div class='commentBlock'>
 +
Often the MockDialogDisplayer used in tests will be configurable. For example, it may have a constructor taking a parameter that says whether the yesOrNo() method returns true or false. So in a test I create an instance of MockDialogDisplayer, as opposed to letting ServiceLoader or the Lookup library to create it. When I hold such an instance, how do I set it as the singleton instance?
 +
 +
--Andrei Badea 11:52, 12 February 2010 (CET)
 +
</div>

JaroslavTulach: New page: Questions? - 2010-02-08 21:15:15

New page: Questions?

New page

Questions?