PacktLib: Appcelerator Titanium: Patterns and Best Practices

Appcelerator Titanium: Patterns and Best Practices

Credits

About the Authors

About the Reviewers

www.PacktPub.com

Preface

Understanding JavaScript Patterns

It's all object(ive)

Understanding scope and the global object

Code structure and formatting

Prototype

Micro optimizations

Summary

Titanium Best Practices

CommonJS

Code formatting

Code validation

Comment meaningfully

Do not pollute the global object

JavaScript instance

CommonJS modules

CommonJS best practices

Managing memory

Summary

Building an Application Using CommonJS and the MVC Pattern

Standards

Frameworks

The architecture

The bootstrap

Multilingual

Directory structure

Naming

The application

The controller

Tools (helpers)

CommonJS require

Callbacks

Model

UI

The controller updated

Fail gracefully

Summary

Cross-platform Design Methods

The difference between DPs and PXs

Understanding Ti.UI.SIZE and Ti.UI.FILL

Choosing a cross-platform layout method

Summary

Using JSONDB as an Alternative to SQLite

Installing the JSONDB module

Using JSONDB queries

Summary

Index