flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Labriola" <labri...@digitalprimates.net>
Subject RE: [RT] From Singletons to Unit-testable code
Date Wed, 08 Feb 2012 14:25:29 GMT
>I could be wrong but I think the plan I wrote about was a step-by-step instruction to get
rid of singletons using a intermediate service locator that can be dropped in the end.

>To me the first step is to get from "unit tests are impossible" (the current state of
the framework) to "they are do-able".  Then unit tests could actually be written. With unit
tests available it would be safer to ease to >a system without a global state.

As you might expect from my posts, I am planning on taking a different approach in my whiteboard.
I am going to provide a version of the framework and compiler with a swappable, minimalistic
injection mechanism and perhaps some basic AOPish concepts like compile time mixins. My personal
thought is that: if the injection mechanism exists, and if people like the way I approached
it, then one by one we can fix individual classes to favor this pattern, slowly increasingly
the flexibility and testability of the framework. The biggest problem in this approach is
actually things like StyleManagement, which I just can't see a way to tackle without major
changes, but that is a discussion for another day.

I have no expectation that my thoughts will be taken wholesale, but I think the best way to
solve the debate is to look at the code side by side (even a subset of the code). See the
complexity and performance differences and then weigh the options.


Notice: This transmission is intended only for the use of the individual or entity to which
it is addressed and may contain information that is privileged or confidential. Any dissemination,
distribution or copying of this transmission by anyone other than the intended recipient is
strictly prohibited. If you have received this transmission in error, please notify the sender
immediately by e-mail or telephone and delete the original transmission. Thank you.

View raw message