PDA

View Full Version : How do you structure your MVC app?



lucaverrascina
22 Sep 2011, 8:10 AM
Hi everyone,

I'm using sencha touch from 3 weeks, and I'm developing an MVC app.

I'd like to know how you structure your folders, I use this structure:

http://dl.dropbox.com/u/766584/Immagine.png

lib: for sencha touch libraries
style: for sencha touch and custom css
resources: for images and other useful stuff
app: contains app.js (that just starts the viewport) and the folders for views, stores, models and controllers

Also I'd like to know how you structure your code, I usually set Panels this way



Navigation.views.UserView = Ext.extend(Ext.Panel, {


//------------------------PANEL PARAMETERS--------------------------------------
//------------------------INITCOMPONENT--------------------------------------------
initComponent: function () {
//CREATE SINGLE COMPONENTS
//IF NECESSARY CREATE GROUPS WITH THE COMPONENTS
//SET ITEMS AND DOCKEDITEMS
Navigation.views.UserView.superclass.initComponent.call(this);
},
//------------------------HANDLERS that refer to the controller-----------------------------------------------------
});

JRS
23 Sep 2011, 8:21 AM
This video from Sencha - Tommy Maintz should answer all your questions
http://www.vimeo.com/17705448

(http://www.vimeo.com/17705448)Good luck
JRS