Free Sample
+ Collection

Appcelerator Titanium: Patterns and Best Practices

Boydlee Pollentine , Trevor Ward

Take your Titanium development experience to the next level, and build your Titanium knowledge on CommonJS structuring, MVC model implementation, memory management, and much more
RRP $14.99
RRP $24.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849693486
Paperback110 pages

About This Book

  • Full step-by-step approach to help structure your apps in an MVC style that will make them more maintainable, easier to code and more stable
  • Learn best practices and optimizations both related directly to JavaScript and Titanium itself
  • Learn solutions to create cross-compatible layouts that work across both Android and the iPhone

Who This Book Is For

If you're an existing Titanium developer – or perhaps a new developer looking to start off your Titanium applications "the right way", then this book is for you. With easy to follow examples and a full step-by-step account of architecting a sample application using CommonJS and MVC, you'll be implementing enterprise grade Titanium solutions in no time.

You should have some JavaScript experience and familiarity with the Titanium development environment, along with a basic knowledge of the development lifecycle and packaging for Android and iOS devices.

Table of Contents

Chapter 1: Understanding JavaScript Patterns
It's all object(ive)
Understanding scope and the global object
Code structure and formatting
Micro optimizations
Chapter 2: Titanium Best Practices
Code formatting
Code validation
Comment meaningfully
Do not pollute the global object
JavaScript instance
CommonJS modules
CommonJS best practices
Managing memory
Chapter 3: Building an Application Using CommonJS and the MVC Pattern
The architecture
The bootstrap
Directory structure
The application
The controller
Tools (helpers)
CommonJS require
The controller updated
Fail gracefully
Chapter 4: Cross-platform Design Methods
The difference between DPs and PXs
Understanding Ti.UI.SIZE and Ti.UI.FILL
Choosing a cross-platform layout method
Chapter 5: Using JSONDB as an Alternative to SQLite
Installing the JSONDB module
Using JSONDB queries

What You Will Learn

  • Make your apps easier to maintain and more memory efficient with CommonJS
  • Understand JavaScript best practices and prototypal inheritance
  • Learn to structure your app in an MVC style pattern with special consideration given to memory management, localization and app layout
  • Understand and implement the new Appcelerator Cloud Services" needs to be completely removed
  • Learn ways to generate and implement cross platform layouts
  • Find alternatives to standard SQLite databases, including JSONDB
  • Learn how to implement a series of Titanium API and JavaScript optimizations
  • Get solutions to creating cross-compatible layouts that work across both Android and the iPhone

In Detail

Titanium Mobile has quickly become the platform of choice for many mobile developers and is growing and changing at a rapid rate. From the implementation of CommonJS,  MVC design patterns and more, the last year in Titanium development has been a rollercoaster of change for the better. With this knowledge at your disposal you’ll be creating top quality, highly capable and stable apps in no time.

This book shows you exactly how to implement all the latest Titanium Mobile best practices into your apps, from a thorough explanation of CommonJS with plenty of examples, through to structuring a complete MVC style codebase. With advanced topics such as implementing patterns and utilizing ACS, through to a thorough investigation of CommonJS and prototype, this book will take you from Titanium Novice to Titanium Ninja in no time!

"Appcelerator Titanium: Patterns and Best Practices" starts off with some explanations on JavaScript practices and advanced topics, before getting stuck into the new CommonJS pattern and using that to implement MVC-style architectures for your application. It continues in a practical, hands on manner, explaining how to perform cross device layouts with different techniques, and how to implement SQL alternatives such as JSONDB.

The book discusses some of the major advanced JavaScript topics, such as prototype and micro optimizations, before leading the developer into a thorough explanation of the CommonJS pattern, MVC implementation and advanced topics such as SQL alternatives and implementing designs for cross device layouts.


Read More