lessons learned from applications that kicked titanium's ass

24
Kevin Whinnery @kevinwhinnery Lessons Learned from apps that kicked Titanium’s ass

Upload: kevin-whinnery

Post on 14-Jun-2015

1.632 views

Category:

Technology


0 download

DESCRIPTION

from the first

TRANSCRIPT

Page 1: Lessons Learned From Applications That Kicked Titanium's Ass

Kevin Whinnery

@kevinwhinnery

Lessons Learnedfrom apps that kicked Titanium’s ass

Page 2: Lessons Learned From Applications That Kicked Titanium's Ass

Agenda

Some Cool Titanium Applications

Problems we saw (and how we fixed them)

Titanium application structure: CommonJS modules and Custom Components

Demo and code walkthrough

Q&A

Page 3: Lessons Learned From Applications That Kicked Titanium's Ass

Some Cool Titanium ApplicationsNBC iPad Application

Late Night with Jimmy Fallon

GetGlue

Wunderlist

Many many more

Page 4: Lessons Learned From Applications That Kicked Titanium's Ass

Awesome!

…but they also kicked our ass…

Page 5: Lessons Learned From Applications That Kicked Titanium's Ass

Big Apps, Big Problems

Cross-platform concerns

Memory Management

Slow initialization times

Multiple Contexts

Code Structure

Page 6: Lessons Learned From Applications That Kicked Titanium's Ass

Cross-Platform Concerns

“Write Once, Run Everywhere” fallacy

Cross-Platform API Parity

Cross-Platform functional differences

Page 7: Lessons Learned From Applications That Kicked Titanium's Ass

SolutionsCross-Platform Concerns

Page 8: Lessons Learned From Applications That Kicked Titanium's Ass

“WORE” Fallacy

Don’t aim for 100% code re-use, because it’s not going to happen (not even on the web)

For many apps, you can get by with branching logic

For complex experiences, re-use components, not your entire set of UI code

Custom components offer the best cross-platform re-use

If your app is made up of small chunks, each chunk will be easier to maintain cross-platform

Page 9: Lessons Learned From Applications That Kicked Titanium's Ass

Cross-Platform Parity/CompatibilityProbably the most annoying thing about our platform

- We’re writing specs to drive testing/implementation for 2.0

- First spec implementation will be with layouts in 1.8

Cross-platform testing essential

Should plan on platform differences, however – check NavigationController demo for one example

Page 10: Lessons Learned From Applications That Kicked Titanium's Ass

Memory Management

No explicit memory management API

Lots of views (images especially) === lots of memory

Unsure when Titanium cleans up

Page 11: Lessons Learned From Applications That Kicked Titanium's Ass

SolutionsMemory Management

Page 12: Lessons Learned From Applications That Kicked Titanium's Ass

How to make Titanium clean upClose windows

Set object references to null

Don’t keep “fat” views in the view hierarchy (images)

Page 13: Lessons Learned From Applications That Kicked Titanium's Ass

Slow initial load times

App loads up too slowly

Windows open too slowly (windows with URLs)

Page 14: Lessons Learned From Applications That Kicked Titanium's Ass

SolutionsSlow load times

Page 15: Lessons Learned From Applications That Kicked Titanium's Ass

Dealing with slow load times

JavaScript evaluation is the slowest part of your application

Defer script loading until absolutely necessary

Don’t load the same script over and over again in a context

Page 16: Lessons Learned From Applications That Kicked Titanium's Ass

Multiple Contexts

Kitchen Sink model

Data sharing is hard

When was code run?

Page 17: Lessons Learned From Applications That Kicked Titanium's Ass

SolutionsMultiple contexts

Page 18: Lessons Learned From Applications That Kicked Titanium's Ass

Dealing with multiple contexts

Don’t

Custom events

Properties API for data transfer

Page 19: Lessons Learned From Applications That Kicked Titanium's Ass

Code Structure

app.js – not very much structure

folder structure?

MVC?

MVVM?

Page 20: Lessons Learned From Applications That Kicked Titanium's Ass

SolutionsCode Structure

Page 21: Lessons Learned From Applications That Kicked Titanium's Ass

Code structure

Many ways to skin that cat

Appcelerator will have a more formal solution soon

Your best bet is to build a suite of components

Demo/Code Walkthrough

Page 22: Lessons Learned From Applications That Kicked Titanium's Ass

Q&AQuestions and Answers

Page 23: Lessons Learned From Applications That Kicked Titanium's Ass

ContactKevin Whinnery@kevinwhinnery

[email protected]

Page 24: Lessons Learned From Applications That Kicked Titanium's Ass

Thank you!