View Full Version : Must MVC pattern directory create?

24 Apr 2013, 2:15 AM

I am new to ExtJs and this might be a stupid question. I'm currently working on a project using ExtJs 4 and adopted the new MVC directory pattern as well as class declaration follows the documentation. I am wondering must the directory structure follow the suggested pattern which are view, model, controller and app? I managed to get my application loaded successfully by keeping the suggested directory structure and I've also try by putting all the class files under same directory and my application loaded successfully as well. From my understanding now, when I define a new class using Ext.define(), it is actually create the namespace and it should have nothing close related to the physical directory structure, am I correct?

24 Apr 2013, 3:39 AM
You dont have to use the structure. It just helps you to minify classnames in some cases. e.g.:

In a controller:

views: [

Will load the class: MyApp.view.MyView

If you dont follow the structure and your view folder is 'foo' for example you would need to define the complete classname:

views: [