1. #1
    Touch Premium Member
    Join Date
    Apr 2011
    Posts
    6
    Vote Rating
    0
    mrdunky is on a distinguished road

      0  

    Default Unanswered: Dynamic architectures: MVC or Ext Loader? Ext.application or Ext.onReady?

    Unanswered: Dynamic architectures: MVC or Ext Loader? Ext.application or Ext.onReady?


    Hi,
    I am trying to make an architectural decision on whether to use MVC, or the more traditional Ext.onReady model with Ext Loader.


    We have a larg-ish system where available menus vary by user role, and can change at run time (based on admin updates). Also, many of the views have grid fields which can vary based on the definition in a database.


    As a result, we cannot define the datastores or controllers at user logon.


    When looking into this on ExtJS, I got the impression that either the stores, or the controllers have to be defined in the Ext.application entry point. Is this correct?
    Are there any work arounds to this? (eg. nesting one application in another, or defining controllers/stores on a view by view basis).


    Are there any dicussion materials or best practice examples on the architectural issues here? I did see Mr. Garcia's article on Ext Loader, but I was not clear how evaluate this against in the light of MVC.
    Are there other consideration here, - eg. any plan to retire the traditional approach in favour of MVC?
    (I can see how MVC can be great in other applications where offline capability is being considered, or wrapping Sencha applications like Phonegap does).

    Many thanks,

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Ext.Loader should not be used in production. The reason for this is it's inefficient to open a new socket for every file. Ext.Loader is best used for development in conjunction with MVC. When you have created your MVC application, the last step before deployment is running the build using the SDK Tools. This will create a custom Ext JS 4.x build and your application files. It does this by means of using the requires and uses and all that jazz.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Touch Premium Member
    Join Date
    Apr 2011
    Posts
    6
    Vote Rating
    0
    mrdunky is on a distinguished road

      0  

    Default Cannot build

    Cannot build


    Hi Mitchell,
    Thank you for the information about the build. I did not realise that.
    However, I am not sure it is relevant in our case, as we can't make a build at release time.
    On our system, the screens are mostly built at run-time (generated dynamically from a database).
    So we tend to have very few .js files, and most of the Ext.* definitions are put as <script... tags in html, or loaded dynamically in response to requests.
    The main thing I wanted to clarify is if MVC needs to have definitions for everything at startup (in Ext.application), or if we can dynamically pull in views and controllers on the fly.

    Kind regards,

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    Answers
    3566
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    In your case, MVC may not be ideal. I would still not recommend that you create a script tag for each class in production.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread