<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Forums Topic: PureMVC Mediator Equivalent</title>
<link>http://mate.asfusion.com/forums/</link>
<description>Forums Topic: PureMVC Mediator Equivalent</description>
<language>en</language>
<pubDate>Thu, 09 Sep 2010 13:06:35 +0000</pubDate>

<item>
<title>iconara on "PureMVC Mediator Equivalent"</title>
<link>http://mate.asfusion.com/forums/topic.php?id=69#post-257</link>
<pubDate>Sat, 09 Aug 2008 09:51:56 +0000</pubDate>
<dc:creator>iconara</dc:creator>
<guid isPermaLink="false">257@http://mate.asfusion.com/forums/</guid>
<description>&#60;p&#62;Ah, sorry, I remembered wrong.
&#60;/p&#62;</description>
</item>
<item>
<title>Nahuel on "PureMVC Mediator Equivalent"</title>
<link>http://mate.asfusion.com/forums/topic.php?id=69#post-256</link>
<pubDate>Fri, 08 Aug 2008 21:42:54 +0000</pubDate>
<dc:creator>Nahuel</dc:creator>
<guid isPermaLink="false">256@http://mate.asfusion.com/forums/</guid>
<description>&#60;p&#62;A quick note Theo, the tag in the view is the &#34;Listener&#34; not the &#34;Dispatcher&#34;.
&#60;/p&#62;</description>
</item>
<item>
<title>iconara on "PureMVC Mediator Equivalent"</title>
<link>http://mate.asfusion.com/forums/topic.php?id=69#post-255</link>
<pubDate>Fri, 08 Aug 2008 21:29:44 +0000</pubDate>
<dc:creator>iconara</dc:creator>
<guid isPermaLink="false">255@http://mate.asfusion.com/forums/</guid>
<description>&#60;p&#62;There is the &#60;code&#62;Dispatcher&#60;/code&#62; tag which you can use in your views to listen to events, that's actually a way to (at least implicitly) call a view directly. What you do is that you dispatch an event in the event map using &#60;code&#62;EventAnnouncer&#60;/code&#62; and listen for it in the view using a &#60;code&#62;Dispatcher&#60;/code&#62;. Didn't think of it before, but I'm not sure I think it's such a good idea. It works, but you get a more coupled architecture.&#60;/p&#62;
&#60;p&#62;Mate is very much more indirect than PureMVC (or Cairngorm), but that isn't something negative. Indirection is usually a sign of a less coupled architecture, which means easier reuse, testing, etc.
&#60;/p&#62;</description>
</item>
<item>
<title>Nahuel on "PureMVC Mediator Equivalent"</title>
<link>http://mate.asfusion.com/forums/topic.php?id=69#post-254</link>
<pubDate>Fri, 08 Aug 2008 21:25:44 +0000</pubDate>
<dc:creator>Nahuel</dc:creator>
<guid isPermaLink="false">254@http://mate.asfusion.com/forums/</guid>
<description>&#60;p&#62;Yes, there is a lot to digest. I'm working on an example that will use different way to do the same thing so you can compare what it is best for you.&#60;br /&#62;
A quick note: If you want to use mediators and you are comfortable  with them you can still use them. You can inject the view in your mediators like this.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;Injectors target=&#38;quot;{MyView}&#38;quot;&#38;gt;
    &#38;lt;MethodInvoker generator=&#38;quot;{MyMediator}&#38;quot;
        method=&#38;quot;setView&#38;quot;
        arguments=&#38;quot;{event.injectorTarget}&#38;quot; /&#38;gt;
&#38;lt;/Injectors&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;In this way, your mediator will have access to the view. And you can call your mediator from a set of &#38;lt;EventHandlers&#38;gt;. So it works in both ways.&#60;/p&#62;
&#60;p&#62;The down side of use mediators is that the mediator knows too much about the view. If you need to test a mediator you need to create a view.&#60;br /&#62;
You can, of course, use interfaces to decouple them and mock up a view. The idea is that you have multiples ways to do that. Theo (iconara) showed you another way to do it. You don't need to follow that approach, but it would be good for you to take a look (go to the links that Theo posted) and understand the pros and cons of each way.
&#60;/p&#62;</description>
</item>
<item>
<title>ZaBlanc on "PureMVC Mediator Equivalent"</title>
<link>http://mate.asfusion.com/forums/topic.php?id=69#post-253</link>
<pubDate>Fri, 08 Aug 2008 20:52:29 +0000</pubDate>
<dc:creator>ZaBlanc</dc:creator>
<guid isPermaLink="false">253@http://mate.asfusion.com/forums/</guid>
<description>&#60;p&#62;Thanks, this is a lot of information to go on.  I've come to grips with the fact that my mind will have to think differently after a year of PureMVC.&#60;/p&#62;
&#60;p&#62;PureMVC Mediators can do anything they want when notified.  So, they can push data (if they haven't dine any binding) or they can directly manipulate the view by, say, disabling fields, moving, etc.&#60;/p&#62;
&#60;p&#62;With Mate, it seems that the only notification to a view of anything is via data binding, or Injectors.  That's it.  It seems limiting.  I'd likely be more inclined to rely on singleton models and use bindSetters.  But, I'm not ruling out that what I do with Mediators can't necessarily be redone to fit the Mate model.
&#60;/p&#62;</description>
</item>
<item>
<title>iconara on "PureMVC Mediator Equivalent"</title>
<link>http://mate.asfusion.com/forums/topic.php?id=69#post-242</link>
<pubDate>Fri, 08 Aug 2008 12:23:06 +0000</pubDate>
<dc:creator>iconara</dc:creator>
<guid isPermaLink="false">242@http://mate.asfusion.com/forums/</guid>
<description>&#60;p&#62;I would answer no to both your questions. There might be ways of doing it, but that would negate many of the benefits of using Mate. PureMVC and Mate are very different application frameworks and many things are fundamentally different.&#60;/p&#62;
&#60;p&#62;As I have understood PureMVC, mediators are used to update the views when the model has changed. The way they do this is by respoding to events and pushing data into the views. In Mate this is instead done using bindings. The tags &#60;code&#62;Injectors&#60;/code&#62; and &#60;code&#62;PropertyInjector&#60;/code&#62; is the means by which these bindings are set up.&#60;/p&#62;
&#60;p&#62;In response to an event you should call methods on a manager object, and let the view be notified that the manager has changed by way of bindings. &#60;/p&#62;
&#60;p&#62;Say that you have an event &#34;removeEmployee&#34;, this could be caught by an &#60;code&#62;EventHandlers&#60;/code&#62; which contains a &#60;code&#62;MethodInvoker&#60;/code&#62; that calls a method called &#34;removeEmployee&#34; on a manager of the type &#60;code&#62;EmployeeManager&#60;/code&#62;. The empoyee manager updates it's state accordingly, removing the employee from its list of employees. This doesn't update the view directly, in fact the view isn't involved in this process at all. &#60;/p&#62;
&#60;p&#62;Elsewhere in the event map we can set up an &#60;code&#62;Injectors&#60;/code&#62; tag for an &#60;code&#62;EmployeeListView&#60;/code&#62;. The tag contains a &#60;code&#62;PropertyInjector&#60;/code&#62; that binds the view's &#34;employeeList&#34; property to the employee manager's &#34;employeeList&#34; property.&#60;/p&#62;
&#60;p&#62;This means that there is no need for a mediator which explicitly updates the view. The view gets updated implicitly when the manager object changes. This leads to less &#34;glue code&#34; and a more decoupled architecture. The downside is that it is more indirect and it can be hard to understand how things happen, when and why (and why not) they happen.&#60;/p&#62;
&#60;p&#62;I hope that this explains some of what you were wondering about.&#60;/p&#62;
&#60;p&#62;By the way, there is one aspect of PureMVC's mediators that isn't covered in the discussion above. Mediators also insulate the views from the rest of the application. There is no equivalent in the Mate framework, but Nahuel and I have been discussing how to use the Presentation Model pattern in Mate (see &#60;a href=&#34;http://mate.asfusion.com/forums/topic.php?id=40&#34; rel=&#34;nofollow&#34;&#62;http://mate.asfusion.com/forums/topic.php?id=40&#60;/a&#62;), although I think we've agreed to call it &#34;model adapter&#34;. The idea is that there is an object mediating between the view and the application. It adapts the application model to something that the view can use, and it translates the actions the user performs on the view into application events (a.k.a. &#34;gestures&#34;). The fundamental difference to PureMVC's mediators is that the view knows about the adapter, but the adapter doesn't know about the view. In fact, the adapter only knows about the things that are injected into it (by the same &#60;code&#62;Injectors&#60;/code&#62; as in my example above, that is, instead of the view being bound to the employee manager, the adapter is, and the view binds to the adapter).
&#60;/p&#62;</description>
</item>
<item>
<title>ZaBlanc on "PureMVC Mediator Equivalent"</title>
<link>http://mate.asfusion.com/forums/topic.php?id=69#post-233</link>
<pubDate>Thu, 07 Aug 2008 18:36:09 +0000</pubDate>
<dc:creator>ZaBlanc</dc:creator>
<guid isPermaLink="false">233@http://mate.asfusion.com/forums/</guid>
<description>&#60;p&#62;I'm very familiar with PureMVC, and particularly love the Mediator concept.  I'm trying to formulate the Mate equivalent.&#60;/p&#62;
&#60;p&#62;The Mediator is fired just like a Command, by a notification.  The difference is that the Mediator knows about views.  A command does not.&#60;/p&#62;
&#60;p&#62;One thing I see is that the &#38;lt;Injectors&#38;gt; supports a &#38;lt;PropertyInjector&#38;gt;, which looks like it sets a field for EVERY view of that type.  This is roughly what I want, except for two things:&#60;/p&#62;
&#60;p&#62;1) I have to set a bindable variable to have this fired.&#60;br /&#62;
2) It's setting a field, not calling a method.&#60;/p&#62;
&#60;p&#62;So, two questions:&#60;/p&#62;
&#60;p&#62;1) Is there a way to set up an Injector so it fires a method (ala BindSetter) on my View rather than setting a variable?&#60;/p&#62;
&#60;p&#62;2) Can I have the method fire straight from an EventHandler, rather than having to first set a field so the Injector fires?&#60;/p&#62;
&#60;p&#62;It seems &#38;lt;Injectors&#38;gt; only supports PropertyInjector, though the docs &#34;suggest&#34; otherwise.  Is this true?
&#60;/p&#62;</description>
</item>

</channel>
</rss>
