0

If I want to build a large application with ExtJS how am I supposed to use Modularized architecture? Ex,

/app
/registration
 /app
   /model
   /view
   /controller
   index.html
 /lab
  /app
    /model
    /controller
    /view
    index.html
index.html

(got it from somehwere :D)

is this the recommended approach?

I need to use MVC architecture too, advice? suggestion?

Simple version of my question :

How to put the code into modules while using MVC with ExtJS :)

================================================= updated on 03-29-2012 :D

I'm new to ExtJS, so i'm still having the problem :(

My intension is to put code in to sperate manageble modules like,

  • core - for core functionality
  • radio - separate module, something realted to Radio
  • tv - separate module, something related to TV

This is what i need

/core
    /controller
    /(...)
/radio
    /controller
    /(...)
/(...)

But as Dimitry told, may be this is impossible (current framework)

So....

are we supposed to do something like below?

/controller
    /CoreController
    /RadioController
    /(...)

If this is the case, im sure i will run in to problems very soon :(

Thanks

Sam
  • 33
  • 1
  • 6
  • this link won't answer my question http://www.sencha.com/learn/the-mvc-application-architecture/ – Sam Mar 27 '12 at 19:50

2 Answers2

1

As a start point, I'd recommend reading over the sencha documentation on using their client side MVC architecture.

The link can be found here: http://www.sencha.com/learn/the-mvc-application-architecture/

dougajmcdonald
  • 19,231
  • 12
  • 56
  • 89
  • 1
    Well i have read that post along time ago :) what i want is an architecture, that i won't get into troubles when i scale the app. – Sam Mar 27 '12 at 19:49
0

The current version of framework does not have a straight forward way to modularize an app. What people generaly do is initialize secondary controllers when they are needed instead of at strartup by app.js

The key is to call init() method on the secondary controller. That sets up it's listeners. Here is an example of such solution: https://stackoverflow.com/a/7649658/834424

Edit: this means you only have one app.js not two as in your original question.

Community
  • 1
  • 1
dbrin
  • 15,525
  • 4
  • 56
  • 83
  • Thanks that makes sense, can you please tell me some more about the folder structure? – Sam Mar 28 '12 at 11:40
  • Sure, the folder structure is exactly the same as in the MVC guide. The only difference is that you do not list your secondary controller in your app.js – dbrin Mar 28 '12 at 17:11
  • yes I think you got it. Depending on your design you may not have that many controllers. but you will have more views. And as long as you keep /app/view/... structure you can nest the folders how you like. – dbrin Mar 29 '12 at 18:18