fidiman
|
|
« on: September 22, 2008, 01:20:41 » |
|
Hello,
I'm new to here.
I'm started by a simple question, i think.
Does mediator sendNotification to proxy or they can call directly ?
thanks.
|
|
|
Logged
|
|
|
|
puremvc
|
|
« Reply #1 on: September 22, 2008, 02:07:27 » |
|
Proxies cannot receive Notifications. This is to keep them portable; not dependent on the use cases and notifications defined by the view and controller regions.
the mediator may retrieve and interact with the methods and properties exposed by the Proxy.
To understand why this would be so, always consider the possibility that your domain model may be reused in a different application with different use cases. The Flex browser-based app might provide walk-up, ever-present web based functionality while a desktop version adds more powerful features for working with data locally and interacting with other desktop apps. Still yet another mobile version might add a ui that makes quick queries against the same remote services.
You have one model and 3 very different apps. So the model should be internally self-consistent, but unaware of the business of the app its a part of.
But from each app's perspective, that model is at the core of their reason for existence. To represent it and allow the user to interact with it. So a relatively intimate familiarity with the model can be expected in the controller and view tiers.
Thus Proxies send but do not receive notifications, while Mediators and Commands may retrieve and interact with Proxies directly.
-=Cliff>
|
|
|
Logged
|
|
|
|
fidiman
|
|
« Reply #2 on: September 23, 2008, 12:05:45 » |
|
very clear !
thanks !
|
|
|
Logged
|
|
|
|
fidiman
|
|
« Reply #3 on: September 23, 2008, 12:56:15 » |
|
So, sendNotification is used in mediator only for communicate with other mediator ?
|
|
|
Logged
|
|
|
|
puremvc
|
|
« Reply #4 on: September 23, 2008, 04:46:36 » |
|
Or to trigger a Command.
-=Cliff>
|
|
|
Logged
|
|
|
|
fidiman
|
|
« Reply #5 on: September 23, 2008, 04:54:43 » |
|
ok, thanks
|
|
|
Logged
|
|
|
|
marek
|
|
« Reply #6 on: September 26, 2008, 04:58:56 » |
|
Need to say that it took me some time to understand it, so just to make clear
---------------------------+----------+---------+ | - actor - | send | receive | ---------------------------+----------+---------+ | view (mediator) | yes | yes | ---------------------------+----------+---------+ | controller (commands) | yes | yes | ---------------------------+----------+---------+ | model (proxies) | yes | no | ---------------------------+----------+---------+
Is it better to send notification from view or better to call command that will do that? What is better habit?
|
|
« Last Edit: October 31, 2008, 02:41:41 by marek »
|
Logged
|
|
|
|
|
fidiman
|
|
« Reply #8 on: October 02, 2008, 11:53:30 » |
|
thanks guys...
|
|
|
Logged
|
|
|
|
|