SlideShare a Scribd company logo
1 of 38
Download to read offline
ALLOYDEEP DIVE, BELOW THE SURFACE, AND OTHER
NAUTICAL METAPHORS
TiConf US
June 28-29 2013
Tremont Hotel in Baltimore
#ticonf
TONY LUKASAVAGE
Alloy Lead Engineer @ Appcelerator
@tonylukasavage
tlukasavage@appcelerator.com
CRASH COURSE
Alloy is an MVC framework for Appcelerator's Titanium
SDK built with Node.js. Through a compilation process it
aims to produce highly optimized, cross-platform
Javascript code.
from on .
CODESTRONG 2012 Breakout session - Alloy (MVC)
Application Framework Overview
Appcelerator Video Channel Vimeo
Models | Views | Controllers | Styles
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
title:'tab 1',
window:win1
});
var label1 = Titanium.UI.createLabel({
text:'tab 1'
});
win1.add(label1);
win1.addEventListener('click',function(e){/* ... */});
var win2 = Titanium.UI.createWindow({
title:'tab 2',
backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({
title:'tab 2',
window:win2
});
var label2 = Titanium.UI.createLabel({
text:'tab 2'
});
win2.add(label2);
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();
DECLARATIVE UI
<Alloy>
<TabGroup>
<Tab title="tab1">
<Window title="tab1" backgroundColor="#fff">
<Label>tab 1</Label>
</Window>
</Tab>
<Tab title="tab2">
<Window title="tab2" backgroundColor="#fff">
<Label>tab 2</Label>
</Window>
</Tab>
</TabGroup>
</Alloy>
TSS
'Window': {
backgroundColor: '#fff',
navBarHidden: true
}
'Label': {
text: L('theString'),
color: '#222',
height: Ti.UI.SIZE,
font: {
fontSize: 18,
fontWeight: 'normal'
}
}
'.shadow': {
shadowColor: Alloy.CFG.shadowColor,
shadowOffset: {x:1,y:2}
}
'#index[platform=android]': {
exitOnClose: true
}
CONTROLLERS
var memory = ['magic show', 'wear $6000 suit'];
function forgetMeNow() {
memory.push('took forget-me-now');
setTimeout(function() { memory.pop() }, 1000 * 60 * 60 * 12);
}
exports.isNude = function() {
return false;
}
exports.isThereMoney = function(location) {
return location === 'banana stand';
}
try {
$.someWindow.open();
} catch (e) {
memory.push("I've made a huge mistake");
forgetMeNow();
}
MODELS
exports.definition = {
config: {
columns: {
item: "text",
done: "integer",
date_completed: "text"
},
adapter: {
type: "sql",
collection_name: "todo"
}
},
extendModel : function(Model) {
_.extend(Model.prototype, {
validate : function(attrs) { /* ... */ }
});
return Model;
},
extendCollection : function(Collection) {
_.extend(Collection.prototype, {
comparator: function(todo) { return todo.get('done'); }
});
return Collection;
}
}
WIDGETS
http://www.danielsefton.com/2012/10/ios-slider-menu-widget-for-titanium-alloy
SYNC ADAPTERS
Alloy + Backbone.js
Data persistence abstraction
Adapters:
SQLite
REST
ACS
CouchDB
BUILTINS
Backbone.js
Underscore.js
Moment.js
Titanium-specific libraries
var moment = require('alloy/moment');
BEST PRACTICES
* Standarize coding practices *
* Embedding Expertise *
* CommonJS *
* Parity Issues *
* Optimizations *
FASTER DEVELOPMENT
HIGH QUALITY APPS
H TO THE IZZO
INSTALLING ALLOY
# latest stable
[sudo] npm install -g alloy
# by version
[sudo] npm install -g alloy@1.1.3
# straight from github
[sudo] npm install -g git://github.com/appcelerator/alloy.git
DYNAMIC STYLING*
Modify and apply styles at runtime
New APIs
Alloy.createStyle()
Alloy.UI.create()
Alloy.addClass()
Alloy.removeClass()
Alloy.resetClass()
*available in Alloy 1.2.0
LISTVIEW MARKUP*
High performance lists
iOS & Android
Transition made easier with Alloy
Data binding support
*available in Alloy 1.2.0
NATIVE MODULES
IN MARKUP*
<Module id="paint" module="ti.paint"
method="createPaintView" platform="ios,android"/>
*available in Alloy 1.2.0
DEVICE OPTIMIZATIONS
Device Queries
Compiler Conditionals
Conditional Configurations
ALLOY.JMK
pre/post processing
Modify, beautify, minify, etc...
Even or , if you're into that sort of
thing
coffeescript Jade
OVERRIDES
NOTHING IS SACRED
...unless it breaks something
Alloy namespace functions
Backbone.js, Underscore.js, etc...
Even the core runtime library (alloy.js)
CONTROLLER
EVENTING
Alloy controllers have Backbone eventing
Lightweight, yet powerful
Loose coupling
VIEW MODEL BINDING
dataCollection
dataTransform
dataFilter
<TableView id="todoTable" dataCollection="todo"
dataFilter="whereFunction" dataTransform="transformFunction">
<Require src="row"/>
</TableView>
SOURCE MAPS
Maps generated code to source, and vice versa
Enables debugging, exceptions, and code processor
config.json toggling
{
"sourcemap": false
}
alloylove.com
COMMUNITY
All-Stars
Fokke Zandenberg ( )
David Bankier ( )
Aaron Saunders ( )
Jason Kneen ( )
Mads Moller ( )
Josh Jensen ( )
Twitter at
@fokkezb
@davidbankier
@aaronksaunders
@jasonkneen
@nappdev
@joshj
#tialloy
Q&A "alloy" tag
Alloy Google Group
THE FUTURE
DYNAMIC THEMES
→
LIGHTER, MORE
POWERFUL MODELING
Peel back the Alloy layer
Develop abstract model interface
Leverage Alloy's and framework of choice's features
NATIVE FORMATS
iOS Nib
Android XML
Native formatting optimizations
PACKAGE
MANAGEMENT
meets
Iterative development independent of Alloy releases
Same conventions, same results
alloylove.com npm
# Install a widget. Package manifest would determine that it's a widget
tpm install someCoolAssWidget
# Install a sync adapter.
tmp install syncToMyToaster
RESOURCES
Official Alloy Documentation
Q&A
Alloy Google Group
Alloy source code
Alloy test app collection
FIND ME
@tonylukasavage
tlukasavage@appcelerator.com
...or drinking whiskey in the next few minutes

More Related Content

Similar to Alloy: Deep Dive, Below The Surface, and Other Nautical Metaphors

Codestrong 2012 breakout session exploring the new titanium command line in...
Codestrong 2012 breakout session   exploring the new titanium command line in...Codestrong 2012 breakout session   exploring the new titanium command line in...
Codestrong 2012 breakout session exploring the new titanium command line in...
Axway Appcelerator
 
JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005
Edoardo Schepis
 
Appcelerator Alloy Deep Dive - tiTokyo 2013
Appcelerator Alloy Deep Dive - tiTokyo 2013Appcelerator Alloy Deep Dive - tiTokyo 2013
Appcelerator Alloy Deep Dive - tiTokyo 2013
Ricardo Alcocer
 
Travelling Light for the Long Haul - Ian Robinson
Travelling Light for the Long Haul -  Ian RobinsonTravelling Light for the Long Haul -  Ian Robinson
Travelling Light for the Long Haul - Ian Robinson
mfrancis
 
Travelling light for the long haul
Travelling light for the long haulTravelling light for the long haul
Travelling light for the long haul
Ian Robinson
 

Similar to Alloy: Deep Dive, Below The Surface, and Other Nautical Metaphors (20)

Titanium Alloy Framework
Titanium Alloy FrameworkTitanium Alloy Framework
Titanium Alloy Framework
 
Extending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native ModulesExtending Appcelerator Titanium Mobile through Native Modules
Extending Appcelerator Titanium Mobile through Native Modules
 
Exploring the Titanium CLI - Codestrong 2012
Exploring the Titanium CLI - Codestrong 2012Exploring the Titanium CLI - Codestrong 2012
Exploring the Titanium CLI - Codestrong 2012
 
Codestrong 2012 breakout session exploring the new titanium command line in...
Codestrong 2012 breakout session   exploring the new titanium command line in...Codestrong 2012 breakout session   exploring the new titanium command line in...
Codestrong 2012 breakout session exploring the new titanium command line in...
 
Git and GitHub for Testers
Git and GitHub for TestersGit and GitHub for Testers
Git and GitHub for Testers
 
Appcelerator Titanium Alloy
Appcelerator Titanium AlloyAppcelerator Titanium Alloy
Appcelerator Titanium Alloy
 
Appcelerator Titanium Alloy
Appcelerator Titanium Alloy Appcelerator Titanium Alloy
Appcelerator Titanium Alloy
 
Angular Extreme Performance - V2
Angular Extreme Performance - V2Angular Extreme Performance - V2
Angular Extreme Performance - V2
 
Angular from Zero to Mastery - Training (Intermediate)
Angular from Zero to Mastery - Training (Intermediate)Angular from Zero to Mastery - Training (Intermediate)
Angular from Zero to Mastery - Training (Intermediate)
 
Giorgio Mandolini - Rapid application development con titanium appcelerator
Giorgio Mandolini - Rapid application development con titanium appceleratorGiorgio Mandolini - Rapid application development con titanium appcelerator
Giorgio Mandolini - Rapid application development con titanium appcelerator
 
JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005JavaME Deploy and Test - JMDF 2005
JavaME Deploy and Test - JMDF 2005
 
Appcelerator Alloy Deep Dive - tiTokyo 2013
Appcelerator Alloy Deep Dive - tiTokyo 2013Appcelerator Alloy Deep Dive - tiTokyo 2013
Appcelerator Alloy Deep Dive - tiTokyo 2013
 
Appcelerator Alloy Deep Dive - tiTokyo 2013
Appcelerator Alloy Deep Dive - tiTokyo 2013Appcelerator Alloy Deep Dive - tiTokyo 2013
Appcelerator Alloy Deep Dive - tiTokyo 2013
 
Titanium appcelerator my first app
Titanium appcelerator my first appTitanium appcelerator my first app
Titanium appcelerator my first app
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Platform 4.0 Meetup Launch Event
Platform 4.0 Meetup Launch EventPlatform 4.0 Meetup Launch Event
Platform 4.0 Meetup Launch Event
 
Travelling Light for the Long Haul - Ian Robinson
Travelling Light for the Long Haul -  Ian RobinsonTravelling Light for the Long Haul -  Ian Robinson
Travelling Light for the Long Haul - Ian Robinson
 
Travelling light for the long haul
Travelling light for the long haulTravelling light for the long haul
Travelling light for the long haul
 
Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9Illia shestakov - The Future of Java JDK #9
Illia shestakov - The Future of Java JDK #9
 
Web Components: Introduction and Practical Use Cases
Web Components: Introduction and Practical Use CasesWeb Components: Introduction and Practical Use Cases
Web Components: Introduction and Practical Use Cases
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Alloy: Deep Dive, Below The Surface, and Other Nautical Metaphors