Results 1 to 4 of 4

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

  1. #1
    Touch Premium Member
    Join Date
    Apr 2011
    Posts
    6
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Touch Premium Member
    Join Date
    Apr 2011
    Posts
    6
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •