first implementation of Cairngorm
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package business;
|
||||
|
||||
import com.adobe.cairngorm.business.ServiceLocator;
|
||||
import feathers.rpc.IResponder;
|
||||
import feathers.rpc.http.HTTPService;
|
||||
|
||||
class LoadRidersDelegate {
|
||||
private var command:IResponder;
|
||||
private var service:HTTPService;
|
||||
|
||||
public function new(command:IResponder) {
|
||||
// constructor will store a reference to the service we're going to call
|
||||
service = ServiceLocator.getInstance().getHTTPService('loadRidersService');
|
||||
// and store a reference to the command that created this delegate
|
||||
this.command = command;
|
||||
}
|
||||
|
||||
public function loadRidersService():Void {
|
||||
// call the service
|
||||
var token = service.send();
|
||||
// notify this command when the service call completes
|
||||
token.addResponder(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package business;
|
||||
|
||||
import com.adobe.cairngorm.business.ServiceLocator;
|
||||
import feathers.rpc.http.HTTPService;
|
||||
|
||||
class Services extends ServiceLocator {
|
||||
public var loadRidersService:HTTPService;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
loadRidersService = new HTTPService();
|
||||
loadRidersService.url = "data/riders.json";
|
||||
loadRidersService.resultFormat = HTTPService.RESULT_FORMAT_JSON;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user