3. Why Adobe AIR?
• Full cross-platform solution
• Web/Desktop/Mobile (iOS/Android/BB)
• Adobe dropped mobile Flash?
• ActionScript developers are still there
Thursday, September 19, 13
7. Service Desk (Proof of concept/Alpha)
Tablet
Web
Phone
Why Adobe AIR?
Thursday, September 19, 13
8. How to deal with UI?
Is Flex UI good?
Flex UI is not Native for most platforms
Runs in Flash Player or AIR Skinning rulez!!!
Thursday, September 19, 13
9. How to deal with UI?
Is Flex UI good?
Flex UI is Native for BlackBerry
BlackBerry 10 and Palybook OS have AIR runtime built-in
Thursday, September 19, 13
10. How to deal with UI?
Is Flex UI good?
Flex UI is not Native for OS
(remember BlackBerry?)
• Pros
• Same UI for all platforms
• Less training / support cost for big corporates
• Cons
• UI has to be perfectly designed to be adopted
Thursday, September 19, 13
11. Specifics of Flex
Requires AIR runtime
•Pros:
• Same codebase for all platforms
• Number of distribution options
•Cons:
• Performance issues, like with any other non-native solution
•Other:
• AIR runtime may be built in with executable
Thursday, September 19, 13
12. Performance?
• UI is slow
• Collections are common but not fast
• High memory usage (AIR runtime)
Thursday, September 19, 13
13. Slower than Native in most some cases
Math calculations are faster than native code on iPad!
Example:
f1(x) = 5.4321 * x 2 + 9.8765 * x
f2(x) = 5.4321 * cos(x)
• Results for
1,000,000 cycles:
C++ Builder XE4 C++ (XCode) Java (Eclipse) Flex
Web
Windows/Chrome
5156 ms 6819 ms
iPad2 24950 ms 26062 ms
iPad4 21306 ms 14064 ms
Nexus 7 14395 ms 18345 ms
Performance?
Thursday, September 19, 13
14. Performance?
Surflex
var sql:Surflex = new Surflex();
sql.CreateTable("Product", "ProductId", Product.generateTestData());
sql.CreateIndex("Product", "CategoryId");
sql.CreateTable("Category", "CategoryId", Category.generateTestData());
sql.CreateTable("Order", "OrderId", Order.generateTestData());
sql.CreateTable("OrderItem", "OrderItemId", OrderItem.generateTestData());
sql.CreateIndex("OrderItem", "ProductId");
sql.CreateIndex("OrderItem", "OrderId");
sql.Insert("Order", new Order(4, "NO 000459", null));
var orderItem:OrderItem = new OrderItem(15, 4, 8, 8, 400);
sql.Insert("OrderItem", orderItem);
orderItem.Price -= 100;
sql.Update("OrderItem", orderItem);
sql.Delete("Order", function(order:Order):Boolean{return order.OrderId == 4;});
sql.CreateTable("Category2", "CategoryId", Category.generateTestData());
var result:Array;
result = sql.Select("SELECT Category.Name AS Category, Product.Name AS Product,
OrderItem.Quantity AS Quantity"
+ ", OrderItem.Price AS Price, Category2.* AS Mistake"
+ " FROM Category"
+ " INNER JOIN Product ON Category.CategoryId = Product.CategoryId"
+ " INNER JOIN OrderItem ON Product.ProductId = OrderItem.ProductId"
+ " INNER JOIN Order ON OrderItem.OrderId = Order.OrderId"
+ " LEFT JOIN Category2 ON Product.ProductId = Category2.CategoryId"
+ " WHERE Product, Order"
+ " ORDER BY Category ASC, Product DESC", new <Function>[
function(product:Product):Boolean{return product.Status;},
function(order:Order):Boolean{return order.OrderId == 2;}
]);
Data: 7 collections of 1-100K items each.
Goal: find items based on some criteria.
Standard for loops: 4000 ms
Surflex query: 650 ms
Thursday, September 19, 13
16. Performance?
Other ways to improve
• Control memory usage with Profiler
• Use proper Collections: Array & Vector vs ArrayCollection
• Use optimized search algorithms (e.g. binary search) to find item
instead of “brute force” for each
• Surflex does its job
• Match class definitions when loading from server
• Read performance tuning tips / best practices
Thursday, September 19, 13
17. How to get data?
Backend?
• ADEP (Adobe Digital Enterprise Platform) /
LiveCycle ES4
• Data access with no line of Java code
• Expensive
• BlazeDS
• Java backend
• Free (reduced ADEP)
• Web services
• XML/AMF (FluorineFx)
Thursday, September 19, 13