Macromedia Flash Server - remoting and class files

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > May 2005 > remoting and class files





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author remoting and class files
grant

2005-05-24, 2:45 am

hi. normally i call remoting like this:

categoryLinks =3D linkCFC.getCategoryLinks({categoryID:catID});
categoryLinks.responder =3D new RelayResponder(this,
"categoryLinks_return", "service_fail");

where the 'categoryLinks_return' and 'service_fail' are the result
handlers for the service call, and 'linkCFC' is a predefined service.

i'm developing some classes and have the need to return the result
from a call directly, such as:

return linkCFC.getCategoryLinks({categoryID:catID});

which would ideally be in a 'getter' function on the class file. is
there a simple way of doing this? what is the correct way to make
remoting calls and retaining encapsulation?

or have i gone down the wrong path? (again)

Grant

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Ken Dunnington

2005-05-27, 5:45 pm

I encapsulate my remote data using beans and DAO's. I have a UserGateway=20
class that acts as my DAO, and I call getUser() on that class, which return=
s=20
a fully populated User object (in reality, it returns the object in an even=
t=20
dispatched by the result function of the RelayResponder object.) Because of=
=20
the asynchronous nature of Flash Remoting, you can't get a result directly=
=20
from a service call, since that always returns a PendingCall object. Once m=
y=20
User object is populated, I can use getters and setters on that as I need=
=20
to. I also have a setUser() method on my UserGateway class which accepts a=
=20
User object as input and stores it back to the server.

Hope that helps,
Ken

On 5/24/05, grant <grantmr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>=20
> hi. normally i call remoting like this:
>=20
> categoryLinks =3D linkCFC.getCategoryLinks({categoryID:catID});
> categoryLinks.responder =3D new RelayResponder(this,
> "categoryLinks_return", "service_fail");
>=20
> where the 'categoryLinks_return' and 'service_fail' are the result
> handlers for the service call, and 'linkCFC' is a predefined service.
>=20
> i'm developing some classes and have the need to return the result
> from a call directly, such as:
>=20
> return linkCFC.getCategoryLinks({categoryID:catID});
>=20
> which would ideally be in a 'getter' function on the class file. is
> there a simple way of doing this? what is the correct way to make
> remoting calls and retaining encapsulation?
>=20
> or have i gone down the wrong path? (again)
>=20
> Grant
>=20
> -----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> -----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20




--=20
It's a metaphor for life itself. For that matter, everything in life is a=
=20
metaphor for life. Except life. Life is probably a metaphor for metaphor. -=
-=20
James Lileks

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com