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

xantrus's Avatar


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?

  1. 1 Posted by neil on 06 Aug, 2011 02:08 PM

    neil's Avatar

    Joel hooks has an example image gallery that demonstrates presentation model using robot legs. Search on

  2. 2 Posted by neil on 06 Aug, 2011 02:14 PM

    neil's Avatar

    Btw, any pattern can be misused or badly written, including PM. Also many devs avoid binding as there are performance and memory issues.

  3. 3 Posted by xantrus on 06 Aug, 2011 03:26 PM

    xantrus's Avatar

    Flex is nonperforming by default, so ... :) Anyway, thanks about the sample, I will have a look

  4. 4 Posted by neil on 06 Aug, 2011 04:30 PM

    neil's Avatar
  5. Ondina D.F. closed this discussion on 02 Nov, 2011 05:30 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac