05-27-05 10: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
[ Post a follow-up to this message ]
|