Migrating from GraniteDS 3.0.0.M3 to 3.0.0.RC1 (Flex) | Granite Data Services


News and Updates

Migrating from GraniteDS 3.0.0.M3 to 3.0.0.RC1 (Flex)

By Franck October 15th, 2013 Flex, GraniteDS No Comments

The ServiceInitializer API has been removed and replaced by ServerSession and IServerApp. The following code:

    = new DefaultServiceInitializer('/myapp');

Should be replaced by:

Tide.getInstance().mainServerSession.serverApp = new SimpleServerApp('/myapp');

Why this (apparently) cosmetic change ? The difference is that you can now create other ServerSession objects for other server applications (other context roots, other server urls, …). Implicit service proxies will still be routed to the main ServerSession, if you want to connect to another server, you will have to attach the service proxies to the other ServerSession:

Tide.getInstance().mainServerSession.serverApp = new SimpleServerApp('/myapp');
var appSession2:ServerSession =
    new ServerSession('/myapp2', false, 'myserver2', '8080');
Tide.getInstance().getContext().appSession2 = appSession2;
Tide.getInstance().getContext().myService2 = new MyService2(appSession2);

// Service proxy for MyService on http://localhost:8080/myapp
public var myService:MyService;

// Service proxy for MyService2 on http://myserver2:8080/myapp2
public var myService2:MyService2;

The GraniteDS Team.

Post Comment

Your email address will not be published. Required fields are marked *