This is a common pattern:


type Tweet {
text : String

}

service Twitter {
resource search(q : String) : [Tweet] {
uri = “…”
mapper = tweetMapper
}
}

function tweetMapper(json : JSON) : [Tweet] {
return json.results;
}

The problem here is that the service does not really return instances of type Tweet here, it just returns objects that look like tweets, but don’t get the same reactive behavior in user interface. For instance:


label(tweet.text)
textField(tweet.text)

Wouldn’t update the label when the textField changes.

Submitted by Zef Hemel on 17 March 2011 at 08:31

Log in to post comments