incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <>
Subject Re: [RT] From Singletons to Unit-testable code
Date Wed, 08 Feb 2012 03:09:35 GMT

On 2/7/12 12:11 PM, "Martin Heidegger" <> 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.

View raw message