PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: denne on June 19, 2009, 01:14:32



Title: EmployeeAdm demo for GWT.
Post by: denne on June 19, 2009, 01:14:32
I found the new demo at http://trac.puremvc.org/Demo_Java_MultiCore_GWT_EmployeeAdmin/browser/tags/EmployeeAdmin_1_0 (http://trac.puremvc.org/Demo_Java_MultiCore_GWT_EmployeeAdmin/browser/tags/EmployeeAdmin_1_0) and checked out the source code because I have used the last 3 weeks reading about and to create my first puremvc based GWT application following all of the best practices.

In the sample application I found that the Mediators has been combined with view components and handølign all notification, view ui and events. Also it tightly communicate with Proxies. From all I have read in the best practices documents and forums I am a little confused when I see this.

I expected the Mediator and UI code to be separated and the UI code not to directly communicate with proxies?


Title: Re: EmployeeAdm demo for GWT.
Post by: aquinault on June 19, 2009, 03:06:04
From the PureMVC_Implementation_Idioms_and_Best_Practices.pdf

The responsibilities for the Mediator are primarily handling Events dispatched from the View Component and relevant Notifications sent from the rest of the system.

Since Mediators will also frequently interact with Proxies, it is common for a Mediator to retrieve and maintain a local reference to frequently accessed Proxies in its constructor. This reduces repetitive retrieveProxy calls to obtain the same reference.

Anthony.


Title: Re: EmployeeAdm demo for GWT.
Post by: denne on June 19, 2009, 04:58:07
from the same PDF file,
"The View primarily caches named references to Mediators. Mediator
code stewards View Components, adding event listeners, sending
and receiving notifications to and from the rest of the system on
their behalf
and directly manipulating their state.
This separates the View definition from the logic that controls it."

eg. Mediator acts as a front to View Components, to decouple the UI from puremvc code and creating a losely coupled system not dependent on display technology and puremvc. As a result, the Mediator should be aware of the View Component and listen to events, but the view components itself should not be dependent on any puremvc components. 
This is also how the conceptual drawing of the PureMvc architecture is shown.


Title: Re: EmployeeAdm demo for GWT.
Post by: puremvc on July 03, 2009, 04:02:38
That is correct.