Академический Документы
Профессиональный Документы
Культура Документы
testing.
Purpose to demonstrate and promote the
utility of IOC Containers for improving
primarily unit testing coverage.
Secondarily class decoupling
and simplification.
vs
With container injection this is
straightforward.
With this approach, the top-level PM is usually instantiated in
the top level view. It may be a singleton to allow other parts of
the application, such as commands to access it as required.
The child PMs are then passed down manually into the child
views, as shown below:
We usually do it this way.
Finally improving on manual DI, not
replacing it.
<example:MyComponent ... >
<mx:Script>
[Bindable]
public var model:MyComponentPM;
</mx:Script>
...
</example:MyComponent/>
Manual Injection
mple:MyComponent ... >
Script>
able]
var model:MyComponentPM;
Script>
mple:MyComponent/>
Containers for Unit Testing
SEE!
http://www.javaranch.
com/journal/200603/EvilUnitTests
.html#toofunc
Why use containers - Agility!