Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
July 21, 2017, 05:46:05 PM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Print
Author Topic: EmployeeAdm demo for GWT.  (Read 6621 times)
denne
Newbie
*
Posts: 6


View Profile
« on: June 19, 2009, 01:14:32 AM »

I found the new demo at 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?
Logged
aquinault
Moderator
Jr. Member
*****
Posts: 10


View Profile Email
« Reply #1 on: June 19, 2009, 03:06:04 AM »

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.
Logged
denne
Newbie
*
Posts: 6


View Profile
« Reply #2 on: June 19, 2009, 04:58:07 AM »

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.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2870



View Profile WWW
« Reply #3 on: July 03, 2009, 04:02:38 PM »

That is correct.
Logged
Pages: [1]
Print
Jump to: