Working in MVCS to trace information
In Pure MVCS timing is everything. In Flex depending on how you set up your views, when injecting classes into another you must be careful where and when you call for parameters.
If called at the incorrect time you will get errors. For instance, if you call in onRegister( ); to be given the index of Child not currently viewable – although you are calling from its mediator – or you call for in in the Event of another Model you will get an error.
The trick to working in Pure MVCS is to be very clinical. It is the perfect programming design pattern for those of us with germ-phobia. The idea is to not let variables (set in the Model) and Events cross the boundaries of their class and methods even if they are working together. Think of construction unions. Electricians’ unions will not work at the same time the Plumbing unions are on sight nor will you see the Masonry union on sight with the Iron union.
Yet and still they seemingly come together at run-time to create a great piece of architecture. The final result is a functioning program that need not rip the entire structure apart to update or fix. You just call the proper Mediator for the appropriate view when needed. To find information about the View simply ask in the view.