|
List Info
Thread: model to model communication
|
|
| model to model communication |
  Romania |
2007-10-17 17:28:23 |
Hi!
Does pixlib have some solution for the case when I need to
actually make a
modelA listen to modelB because the change in modelB is not
from a command
but from the server?
Maybe this is more a general question but any hint from the
masters would
be great
_______________________________________________
Pixlib mailing list
Pixlib osflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org
|
|
| Re: model to model communication |

|
2007-10-17 17:51:12 |
|
A quick answer... What you could do is firing a command when you are receiving result in your proxy class. ( modelB ) or you can make modelA implementing your ProxyListener ( if you need custom event, as I'm sure you will ) and add it to the listener collection of your modelB.
modelB.addListener ( modelA ) or when you are calling a command that fire ( by any way ) a method call on the server you could put a callback that would update modelB and modelA like eg ( here it's AS3, adapt the Delegate for AS2 )
override public function execute( e : Event = null ) : void { ProxyServices.getInstance().getPoll( Delegate.create( _onResult ), Delegate.create( _onFault ) ); }
private function _onResult( result : * ) : void { // update here }
private function _onFault( fault : * ) : void { }
is calling the getPoll on my proxy class
In this function I have
public function getPoll( onResult : Function, onFault : Function ) : void var responder : Responder = new Responder( onResult, onFault); _ncService.call("url", responder );
}
Hope that could help ++
2007/10/18, dev binarycrafts.com">dev binarycrafts.com < dev binarycrafts.com">dev binarycrafts.com
>:Hi! Does pixlib have some solution for the case when I need to actually make a
modelA listen to modelB because the change in modelB is not from a command but from the server? Maybe this is more a general question but any hint from the masters would be great 
_______________________________________________
Pixlib mailing list Pixlib osflash.org">Pixlib osflash.org http://osflash.org/mailman/listinfo/pixlib_osflash.org
-- ---------------------------------------------------------------------- Xavier MARTIN aka zeflasher or xxlm Visit my website if you love flash:
http://www.webbymx.net http://dev.webbymx.net ----------------------------------------------------------------------
|
| Re: model to model communication |

|
2007-10-18 00:39:23 |
|
Hello 
You can use PIXLib in AS3 ?
EKA+ 
2007/10/18, Xavier MARTIN < zeflasher gmail.com">zeflasher gmail.com>:
A quick answer... What you could do is firing a command when you are receiving result in your proxy class. ( modelB ) or you can make modelA implementing your ProxyListener ( if you need custom event, as I'm sure you will ) and add it to the listener collection of your modelB.
modelB.addListener ( modelA ) or when you are calling a command that fire ( by any way ) a method call on the server you could put a callback that would update modelB and modelA like eg ( here it's AS3, adapt the Delegate for AS2 )
override public function execute( e : Event = null ) : void { ProxyServices.getInstance().getPoll( Delegate.create( _onResult ), Delegate.create( _onFault ) ); }
private function _onResult( result : * ) : void { // update here }
private function _onFault( fault : * ) : void { }
is calling the getPoll on my proxy class
In this function I have
public function getPoll( onResult : Function, onFault : Function ) : void var responder : Responder = new Responder( onResult, onFault); _ncService.call("url", responder );
}
Hope that could help ++
2007/10/18, dev binarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dev binarycrafts.com
< dev binarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dev binarycrafts.com
>:Hi! Does pixlib have some solution for the case when I need to actually make a
modelA listen to modelB because the change in modelB is not from a command but from the server? Maybe this is more a general question but any hint from the masters would be great 
_______________________________________________
Pixlib mailing list Pixlib osflash.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Pixlib osflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org
-- ---------------------------------------------------------------------- Xavier MARTIN aka zeflasher or xxlm Visit my website if you love flash:
http://www.webbymx.net http://dev.webbymx.net ----------------------------------------------------------------------
_______________________________________________ Pixlib mailing list osflash.org">Pixlib osflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org
|
| Re: model to model communication |

|
2007-10-18 03:11:37 |
Hi,
May be that server interaction shouldn't be the
responsibility of the
model but rather handled by a command. This server response
results from
a server requests that results from a user interaction (in
some sort of
way), which is the job of control logic, ie commands. That's
why I have
the commands handle the server requests and responses and
update the
required models accordingly.
This helps keeping the model focused on its work, otherwise
it can grow
rapipdly with all this server interaction logic. Plus it
keeps the
server interaction modular since you can have one command
per server
request.
Hope this helps,
fluxs
dev binarycrafts.com a écrit :
> Hi!
> Does pixlib have some solution for the case when I need
to actually make a
> modelA listen to modelB because the change in modelB is
not from a command
> but from the server?
> Maybe this is more a general question but any hint from
the masters would
> be great
>
> _______________________________________________
> Pixlib mailing list
> Pixlib osflash.org
> http://osflash.org/mailman/listinfo/pixlib_osflash.org
>
>
>
_______________________________________________
Pixlib mailing list
Pixlib osflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org
|
|
| Re: model to model communication |

|
2007-10-18 03:16:13 |
|
Flux > this is what I'm doing. I have a ProxyClass that handle all the interaction with the server. Commands call this proxyclass. Callback ( result, fault ) are done on the calling command. Then the command can do whatever depending on those results...
Eka> yup kinda. it's called lowRa. 
2007/10/18, fluxs < fluxs free.fr">fluxs free.fr>:
Hi,
May be that server interaction shouldn9;t be the responsibility of the model but rather handled by a command. This server response results from a server requests that results from a user interaction (in some sort of
way), which is the job of control logic, ie commands. That's why I have the commands handle the server requests and responses and update the required models accordingly.
This helps keeping the model focused on its work, otherwise it can grow
rapipdly with all this server interaction logic. Plus it keeps the server interaction modular since you can have one command per server request.
Hope this helps, fluxs
dev binarycrafts.com">
dev binarycrafts.com a écrit : > Hi! > Does pixlib have some solution for the case when I need to actually make a > modelA listen to modelB because the change in modelB is not from a command > but from the server?
> Maybe this is more a general question but any hint from the masters would > be great  > > _______________________________________________ > Pixlib mailing list > Pixlib osflash.org">
Pixlib osflash.org > http://osflash.org/mailman/listinfo/pixlib_osflash.org > > >
_______________________________________________
Pixlib mailing list Pixlib osflash.org">Pixlib osflash.org http://osflash.org/mailman/listinfo/pixlib_osflash.org
-- ---------------------------------------------------------------------- Xavier MARTIN aka zeflasher or xxlm Visit my website if you love flash:
http://www.webbymx.net http://dev.webbymx.net ----------------------------------------------------------------------
|
| Re: model to model communication |

|
2007-10-18 03:31:20 |
|
That's right Xavier!
I simply wanted to say it in a less implementational manner.
Xavier MARTIN a écrit :
mail.gmail.com"
type="cite">Flux > this is what I'm doing.
I have a ProxyClass that handle all the interaction with the server.
Commands call this proxyclass. Callback ( result, fault ) are done on
the calling command. Then the command can do whatever depending on
those results...
Eka> yup kinda. it's called lowRa. 
2007/10/18, fluxs <free.fr">fluxs free.fr>:
Hi,
May be that server interaction shouldn't be the responsibility of the
model but rather handled by a command. This server response results from
a server requests that results from a user interaction (in some sort of
way), which is the job of control logic, ie commands. That's why I have
the commands handle the server requests and responses and update the
required models accordingly.
This helps keeping the model focused on its work, otherwise it can grow
rapipdly with all this server interaction logic. Plus it keeps the
server interaction modular since you can have one command per server
request.
Hope this helps,
fluxs
binarycrafts.com">dev binarycrafts.com
a écrit :
> Hi!
> Does pixlib have some solution for the case when I need to
actually make a
> modelA listen to modelB because the change in modelB is not from a
command
> but from the server?
> Maybe this is more a general question but any hint from the
masters would
> be great 
>
> _______________________________________________
> Pixlib mailing list
> osflash.org">
Pixlib osflash.org
> http://osflash.org/mailman/listinfo/pixlib_osflash.org
>
>
>
_______________________________________________
Pixlib mailing list
osflash.org">Pixlib osflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org
--
----------------------------------------------------------------------
Xavier MARTIN aka zeflasher or xxlm
Visit my website if you love flash:
http://www.webbymx.net
http://dev.webbymx.net
----------------------------------------------------------------------
|
| Re: model to model communication |
  Romania |
2007-10-18 04:01:06 |
Thanks guys.
I'm always amazed on how pixlib gathered the best Flash
brains. From
France and the francophone world mainly but it's definitely
global
Makes sense to put it in commands.
My case is a bit special because I handle red5 remote shared
objects.
So you don't have a client call just a server push via
onSync.
What I do is just create a command for each shared object I
need to watch
and have the so.onSync call the execute(). In the execute
goes all the
mess but at least the goal is achieved: I isolate that
shared object
activity in it's own command. If you have suggestions on how
to improve
this please reply.
cosmin
_______________________________________________
Pixlib mailing list
Pixlib osflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org
|
|
| Re: model to model communication |
  Belgium |
2007-10-18 01:25:58 |
|
|
No if you want to use AS3 you should use LOWRA witch is the new implementation of pixlib in AS3 from francis Bourre
gilles Le 18-oct.-07 à 07:39, ekameleon a écrit :
Hello 
You can use PIXLib in AS3 ?
EKA+ 
2007/10/18, Xavier MARTIN < zeflasher gmail.com">zeflasher gmail.com>: A quick answer... What you could do is firing a command when you are receiving result in your proxy class. ( modelB ) or you can make modelA implementing your ProxyListener ( if you need custom event, as I'm sure you will ) and add it to the listener collection of your modelB. modelB.addListener ( modelA ) or when you are calling a command that fire ( by any way ) a method call on the server you could put a callback that would update modelB and modelA like eg ( here it's AS3, adapt the Delegate for AS2 )
override public function execute( e : Event = null ) : void { ProxyServices.getInstance().getPoll( Delegate.create( _onResult ), Delegate.create( _onFault ) ); } private function _onResult( result : * ) : void { // update here }
private function _onFault( fault : * ) : void { }
is calling the getPoll on my proxy class In this function I have
public function getPoll( onResult : Function, onFault : Function ) : void var responder : Responder = new Responder( onResult, onFault); _ncService.call("url", responder ); }
Hope that could help ++
2007/10/18, dev binarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dev binarycrafts.com < dev binarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dev binarycrafts.com >:Hi! Does pixlib have some solution for the case when I need to actually make a modelA listen to modelB because the change in modelB is not from a command but from the server? Maybe this is more a general question but any hint from the masters would be great 
_______________________________________________ Pixlib mailing list Pixlib osflash.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Pixlib osflash.org http://osflash.org/mailman/listinfo/pixlib_osflash.org
-- ---------------------------------------------------------------------- Xavier MARTIN aka zeflasher or xxlm Visit my website if you love flash: http://www.webbymx.net http://dev.webbymx.net ---------------------------------------------------------------------- _______________________________________________ Pixlib mailing list osflash.org">Pixlib osflash.org http://osflash.org/mailman/listinfo/pixlib_osflash.org
_______________________________________________ Pixlib mailing list Pixlib  osflash.or g">Pixlib osflash.org BERTRAND Gilles DIRECTOR 248, rue des canadiens 7022 HYON BELGIUM PHONE +32 499 529229 MOBILE +32 499529229
local"> |
 |
| View Original Image |
[1-8]
|
|