Type/entities from web services are not really instances
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:Submitted by Zef Hemel on 17 March 2011 at 08:31
label(tweet.text)
textField(tweet.text)
Wouldn’t update the label when the textField changes.
Log in to post comments