4. HVORFOR CROSS PLATFORM
• Én kodebase
– Samme features på alle platforme
• Én udviklingsafdeling
– Java, objective-c, c# samlet i ét
• Kortere produktionstid
– 60% hurtigere udviklingstid
– Oftere nye features
9. BACKBONE – HVAD ER DET?
– Overførsel af data
• Typisk fra server til app
– Databehandling
• Sortering, filtering mv.
– Gem data lokalt i appen
• Database, filsystem
– Bygger på RESTful JSON
– Uafhængig af data strukturen
• XML, JSON osv..
10. BACKBONE I ALLOY
Adapter
exports.definition = {
config: {
columns: {
"city": "string",
"name": "string"
},
adapter: {
type: "sql",
collection_name: "baseball"
}
},
extendModel: function(Model) {
_.extend(Model.prototype, {
// extended functions and properties go here
});
return Model;
},
extendCollection: function(Collection) {
_.extend(Collection.prototype, {
// extended functions and properties go here
});
return Collection;
}
}
11. BACKBONE I ALLOY
Controller
var teams = Alloy.createCollection('baseball'); // get adapter
teams.fetch(); // get data from remote server
$.index.open(); // open window
View
<Alloy>
<Window class="container">
<TableView id="table" dataCollection="baseball">
<TableViewRow>
<Label id="city" text="{city}"/>
<Label id="name" text="{name}"/>
</TableViewRow>
</TableView>
</Window>
</Alloy>
16. MIDDLEWARE – HVORFOR?
• Mission: “Thin client”
– Jo mindre app’en gør, desto bedre
• Det positive
– Hurtigere app
– Mindle ventetid for app brugeren
– Nemmere opdatering/fejlrettelse
• Det negative
– Kræver langt større servere
19. CASE: ORBICON
• I felten med en tablet
– SOAP webservice
• SOAP Backbone adapter
• Oversæt XML -> JSON
– Custom kort / overlays
– Kort data
– Tracking