i'm new to appcelerators titanium and javascript and i'm interested in coding an iphone app. i recognized that there is a need of "many" code for creating the UI. that's no problem so far, but i tend to separate that code from my application logic wisely. what are the best practices?
[update] tweetanium is a great example how to structure a titanium mobile application
i'll have a try:
i tend to use the mvc-pattern for developing my application since implementing all stuff in one single js-file is quite ugly. so i decided to use one file for the view and all the stuff concering the look-and-feel, one file for the database handling (the controller), especially the sql-statements, and one file for the abstract data type (the model).
a short example:
view: viewConcerningObject.js
model: object.js
controller: controllerConcerningObject.js
so the folder structure could be like this:
myProject: folderView(viewConcerningObject.js), folderModel(theDatabase.db,object.js), folderController(controllerConcerningObject.js).
ok, i just found a cool practice.
i include the con_file.js with the application logic the view_file.js with
now i'm able to access the hole data structure.