List Info

Thread: model to model communication




model to model communication
country flaguser name
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
Pixlibosflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org


Re: model to model communication
user name
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, devbinarycrafts.com">devbinarycrafts.com < devbinarycrafts.com">devbinarycrafts.com &gt;:
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
Pixlibosflash.org">Pixlibosflash.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
user name
2007-10-18 00:39:23
Hello

You can use PIXLib in AS3 ?

EKA+

2007/10/18, Xavier MARTIN < zeflashergmail.com">zeflashergmail.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 )

 ; &nbsp;  &nbsp;  override public function execute( e : Event = null ) : void
 ; &nbsp;  &nbsp;  {
 &nbsp;   &nbsp;   &nbsp;  ProxyServices.getInstance().getPoll( Delegate.create( _onResult ), Delegate.create( _onFault ) );
 &nbsp;   &nbsp;  }
 &nbsp;   &nbsp; 
 &nbsp;   &nbsp;  private function _onResult( result : * ) : void
 ; &nbsp;  &nbsp;  {
// update here
 ; &nbsp;  &nbsp;  }

 &nbsp;   &nbsp;  private function _onFault( fault : * ) : void
 ; &nbsp;  &nbsp;  {
 &nbsp;   &nbsp;  }

is calling the getPoll on my proxy class
In this function I have

public function getPoll( onResult : Function, onFault : Function ) : void
 ; &nbsp;  &nbsp;   &nbsp;  var responder : Responder = new Responder( onResult, onFault);
  ;   &nbsp;   &nbsp;  _ncService.call(";url", responder );
}

Hope that could help
++


2007/10/18, devbinarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">devbinarycrafts.com < devbinarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">devbinarycrafts.com &gt;:
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
Pixlibosflash.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Pixlibosflash.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">Pixlibosflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org


Re: model to model communication
user name
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



devbinarycrafts.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
> Pixlibosflash.org
> http://osflash.org/mailman/listinfo/pixlib_osflash.org

>
>
>   


_______________________________________________
Pixlib mailing list
Pixlibosflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org


Re: model to model communication
user name
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 < fluxsfree.fr">fluxsfree.fr&gt;:
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



devbinarycrafts.com"> devbinarycrafts.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
&gt; but from the server?
> Maybe this is more a general question but any hint from the masters would
> be great
>
> _______________________________________________
> Pixlib mailing list
> Pixlibosflash.org"> Pixlibosflash.org
> http://osflash.org/mailman/listinfo/pixlib_osflash.org
>
>
>


_______________________________________________
Pixlib mailing list
Pixlibosflash.org">Pixlibosflash.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
user name
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">fluxsfree.fr&gt;:
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">devbinarycrafts.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
&gt; be great
>
> _______________________________________________
> Pixlib mailing list
>; osflash.org"> Pixlibosflash.org
> http://osflash.org/mailman/listinfo/pixlib_osflash.org
>
>
>


_______________________________________________
Pixlib mailing list
osflash.org">Pixlibosflash.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
country flaguser name
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
Pixlibosflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org


Re: model to model communication
country flaguser name
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 < zeflashergmail.com">zeflashergmail.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, devbinarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">devbinarycrafts.com < devbinarycrafts.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">devbinarycrafts.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
Pixlibosflash.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Pixlibosflash.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">Pixlibosflash.org
http://osflash.org/mailman/listinfo/pixlib_osflash.org


_______________________________________________
Pixlib mailing list
Pixlibosflash.org">Pixlibosflash.org

BERTRAND Gilles
DIRECTOR
248, rue des canadiens 
7022 HYON
BELGIUM
PHONE +32 499 529229
MOBILE +32 499529229


local">

View Original Image
[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )