On 2/7/12 12:11 PM, "Martin Heidegger" <m...@leichtgewicht.at> wrote:

> Hello List,
> 
> when thinking about unit testing of Flex components I got a strong
> argument against it due to the heavy use of Singletons throughout the
> project. I think I might have a good refactoring path to ease the
> transition from the current code to a code that might be easier manageable.
> 

> I know that this approach is quite a long one but I think it could be
> done step by step without creating too much friction at each point in time.
> 
> What do you think?
I don't understand what this does other than what mx.core.Singleton already
does.  The only issue I know of is there is no place in the application
lifecycle that gives you a clean chance to swap out the implementation. That
is much more easily fixed.

And then there are some old singletons like EffectManager that still use
static methods, which should be using Singleton instead.

And then there is the whole debate about Singletons in general...
-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui

Reply via email to