As everything in software engineering SOs have its advantages and
disadvantages. Using them instead custom server-side methods will keep your
code simpler and cleaner to an extent, while passing data through a Shared
Object could seem quite obscure to some readers. Also note that using SO
your code would suit perfectly in FMS enviroments so if that (compatibility)
is a requirement then that's your choice.
It really depends on what your needs are and how you feel about filling your
code with calls and invokes client and server sides, real-time restrictions,
compatibility issues and so on. If the functionality you're trying to add
doesn't involve a very complex logic just try both alternatives if you have
the time and test them, maybe one of them would work better for some reason.
Luck
Carlos
On 12/29/06, Nankun Huang <[EMAIL PROTECTED]> wrote:
Hi,
First, I was wondering what are the advantages of using shared
objects vs just declaring my own classes within the server. If I use
my own classes, I can simply use the invoke() method to update the
client's state when the value of my own objects change. Whats the
point of SO besides persistence?
I was looking through the clientManager example in tutorials folder
of webapps. This example uses a shared object to manage all of its
clients. What interests me is that instead of using the
createSharedObject(IScope scope, String name, boolean persistent)
function to get the shared object, its simply use the
ISharedObjectService service = (ISharedObjectService)
ScopeUtils.getScopeService(scope,ISharedObjectService.class);
return service.getSharedObject(scope, name, persistent);
in order to get the shared object. How do you get a shared object
which you have not created? does it create the shared object
automatically when its not present? So doesn't make the
createSharedObject function redundant?
Thanks
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org
--
-------------------------------------------------------------------
"Nos gusta los domingos ir al parque a pinchar los globos de los niƱos para
verlos llorar" .- Eskorbuto
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org