Talk:Injectable Singleton

From APIDesign

(Difference between revisions)
Jump to: navigation, search
(Comment provided by Andrei Badea - via ArticleComments extension)
(Andrei Badea said ...)
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>

Revision as of 10:53, 12 February 2010

Questions?

Andrei Badea said ...

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)

Personal tools
buy