Hi,
we had lately the same issue with testing and singletons. We solve the
problem by giving the instance of the singleton to the constructor of the
class to test. That way, we did't need to extend the original singleton and
could use a mock object. Another good trick for testing singletons is to
access / delete the instance of the singleton with $$instance on the class. 

delete your.class.$$instance; // deletes the instance of the singleton

But back to the extending singleton problem. I don't see a clear solution
for extending singletons (have two instances of a singleton is really no
solution!). So I think we should keep the current solution.
Best,
Martin
-- 
View this message in context: 
http://n2.nabble.com/Extending-a-singleton-class-tp4593441p4610891.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to