mediator

When would you use the mediator design pattern

As the title states when would you recommend the use of the mediator design pattern and where do you see it used incorrectly? ...

The Mediator Design Pattern in OCaml

I am trying to accomplish a mutual binding between two classes in OCaml (a la Mediator Pattern's) and am getting an error upon compilation. class virtual ['mediator] colleague mIn = object val m = mIn method virtual getmediator : 'mediator end;; class concreteColleague mIn = object inherit colleague method getmediator = m end;; (...

Mediator pattern or too much responsibility

In my application, I have several components that have to know about each other, such as a menu bar and a tool bar that both need to know about the table to add or remove jobs and also to find out which job is selected. So, I created a object called guiMediator that I pass to every object and they register themselves with it so that the...

Does Mediator Pattern work in this situation?

So for my current project, there are basically three main Java classes: GUI Instant Messaging Computation Essentially, there needs to be full communication, so we've decided to use the mediator approach rather than than allow the GUI to run the entire project. Basically, the mediator is going to encapsulate the communication. The pr...

pureMVC: unique mediator for each tab in an interface.

Hello, I am building a tabbed interface for switching between various similar layers. Each layer will have a number of graphs. By dragging with the mouse the graphs can be rearranged or even moved between layers. My question is, is it best practice to register a unique mediator for each layer that keeps track of the layers content / ...

Unit Testing with the Mediator Pattern - All Private to Public

I am using the mediator pattern to facilitate unit testing of GUI objects. psudo code Example: Class MyGuiClass { //... Declare and initialize mediator to be a MyMediator private void On_SomeButtonPressed() { mediator.SomeButtonWasPressed(); } } Class MyMeditator { public void On_SomeButtonPressed() { //.. Do so...

MVVM Mediator multiple instances

Can someone explain how the mediator pattern works with multiple instances. My code in the view: public MyView() { Mediator.Register("CloseWindow",()=>Close()); } and in the ViewModel: public SomeMethod() { Mediator.Notify("CloseWindow"); } This works find as long as there is only one instance of the View - ViewModel pair....

WPF MVVM dialog example

Does anyone have any examples of showing a window dialog using MVVM (Prism)? - for example a configuration settings window when a command is executed. All of the examples I've seen use the mediator pattern which is fine, but they also all have a reference to the view in the view model which is not ideal (we're using DataTemplates) Than...

Flex PureMVC: Mediator not registering

A component is created at runtime and a mediator is created and registered. All is well. In a separate view, another instance of that component is created. The mediator is created but onRegister() isn't called the 2nd time. I don't know if this is normal... but if it is, how do I get it to call onRegister() the second time? Thanks. ...

Mediator Pattern for trivial messages ?

Hi, Is it a good programming practice to use the mediator pattern for trivial messages (show an image viewer window etc.) ? Mediator.NotifyColleagues(Messages.DISPLAY_IMAGE, image); instead of just using frmImageViewer.Show(image); I use the mediator program in my program a lot and was wondering how much is too much. Regards, ...

Mediator pattern- import wizard c#

Hi guys, i need to build a very simple wizard that will import a text file into a application in three steps and i need to use a mediator pattern. Im just wondering if there are some example applications or some tutorials or documentation. i tryed to search for some on the internet but did not find any examples. ...

File Transfer Mediator

Hi I am searching for a ready made solution for the following problem: I have 3 computers, A, B and C. I want to transfer file(s) from computer A to a specific directory(s) in computer C. The problem is that the transfer speed is very low between A to C and therefore I want that B will be a mediator. I want that to transfer the file(s) f...

Trouble applying the mediator pattern in ASP.NET C# with generic List datasources

I'm working on a large ASP.NET project with a CMS driving lots of data. We have lots of modular components on our pages defined as ASCX controls. Several of these controls need to know about each other to know what data to get from the CMS (i.e. if there's a list of articles in one control, another similar control on the same page cannot...

Communication between 6 ViewModels and a Messenger == AntiPattern ?

A common approach for communication between 2 ViewModels is this: http://stackoverflow.com/questions/2474768/mvvm-view-model-view-model-communications The Mediator pattern or a Messenger class. But what about 6 ViewModels in one Window? NewSchoolclassUserControl NewPupilUserControl SchoolclassListUserControl PupilListUserControl Pupi...

Send an IOrder from ViewModel1 to ViewModel2 with a Messenger, how do you differentiate ADD/DEL ?

Hello, I have a CustomerListViewModel and a OrderListViewModel. In the latter I select an order to delete it or I create a new one. In both situations my CustomerListViewModel and the Messenger must register to the type IOrder: Messenger.Default.Register<IOrder>(this, AddOrder); Messenger.Default.Register<IOrder>(this, DeleteOrder); ...

Cross fire with Messenger system between ViewModels causes Problems...

I have a DateNavigatorViewModel + DateNavigatorView on my ButtonBar. Below are 2 Views which get exchanged: DailyView and WeeklyView. Each View has a DailyViewModel and WeeklyViewModel. In my DateNavigatorViewModel I have messenger.Send(SelectedDate); In my DailyViewModel and WeeklyViewModel each register in the constructor: messenge...

MVVM: Using a Messenger only with custom objects to make Send<> "id" unique ?

Hello, what I do not like about the Messenger I use (mvvm light toolkit) that when I register to DateTime and I send something other parts of my application get the datatime data too because they registered to "DateTime" type. To prevent that I have to create always custom objects and wrap my datetime value. Thats stupi. How do you wo...