PDA

View Full Version : Must MVC pattern directory create?



plchia
24 Apr 2013, 2:15 AM
Hi,

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?

Arg0n
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: [
'MyView'
]


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: [
'MyApp.foo.MyView'
]