Presentation model vs. mediator (for a Flex-based app)

xantrus

06 Aug, 2011 12:00 PM

I recently found out that RL context supports viewMap, i.e.
direct injection into views. This approach, however is nowhere to
be found, neither does the "best practices" doc, not the API doc
give clear explanation.

To me, injection into views is a very nice approach, especially
for Flex-based apps, as it opens the door to patterns like
"presentation model" or MVVM (known from Siverlight/WPF). Both
approaches can benefit fully from the binding capabilities of Flex.
I am not against the mediator pattern, but I DO think that many
people tend to overuse its abstraction, simply because they are not
familiar with the original intention of the pattern (from the GoF
book). Yes, I realize the fact that the view will know about the
presentation model, but doesn't the same thing happen with badly
written mediators, which tend to dig deeply within views? I am
saying, coupling will always be there, no matter what one tries to
do to avoid, so in small dosages, why not just bear with it, and
take advantage of the benefits that a given approach offers us?

I did a small app, where I injected a presentation model into
directly a view, and it worked like a bliss.

I would like to know first why it is quite unpopular, and
second, I heard that there are some performance issues with the the
viewMap. Is that true and if yes, how can I avoid them?