Community
Participate
Working Groups
In 0.2-M4, we support the notion of "local services" in the service registry. The idea is that these services are instantiated by the page and handed to the registry. The registry can then call these services directly rather than going through the hub or some other sandbox. This is good. BUT...some of our application services have code that assumes they are local. They are keeping track of listener instances, etc. and directly calling them. This is bad. The services themselves should not ever assume they are always local. I think the solution is that all eventing, even from local services, is handled by the registry.
Along with bug 334197 I'd like to use this bug to track cleaning up the service registry to a point where the differences between remote and local services is safely hidden away. Targetting end of next week.
From my point of view this bug is now fixed. There's more cleanup to do in bug 334197 and others, but the basic complaint here is resolved. Simon, you can decide if you want to close this bug.
For those who want to know about the types of changes, I'll document here. The basic change for client code is from (OLD PATTERN): registry.callService("name", "method", null, [arg list]); to something that looks more like a promise. (NEW PATTERN): registry.getService("name").then(function(service) { service.method(arg1, arg2); }); And for adding listeners, we now use listener event types. OLD PATTERN registry.callService("name", "addFooListener", null, [function(stuff) { deal with stuff }]); NEW PATTERN registry.getService("name").then(function(service) { service.addListener("stuffChanged", function(stuff) {deal with stuff}); }); If you were using the service registry callbacks (this was not common) like this (OLD PATTERN): registry.callService("name", "method", function(result) {doSomething}, [arg list]); the NEW PATTERN is: registry.getService("name").then(function(service) { return service.method(arg1, arg2); }).then(function(result) {doSomething});
Although the bug calls out local services, I want to finish my current round on re-integrating remote services back in before closing. Also, we need to update the wiki with the new service related apis.
Moving bugs targeting past milestones...
Resolving in the past...