PDA

View Full Version : Best Place to put Ux directory



dawesi
22 Oct 2011, 8:41 PM
I'm building a nice large app using MVC, just wondering where most people are putting their ux's...

As I try to keep extensions and ui in version specific directories, I put mine in :




app
- controller
- model
- store
- view
resources
- css
- images
- ux ( for site/app specific ux )
lib (virtual directory linked in)
- jsframeworks
- jquery
- sencha
- extjs
- version4
- extjs-4.0.2
- extjs-4.0.6
- extjs-4.0.7 (mapped to 'latest' virt dir)
- ux (global ux's)
- ui (global themes)
- touch



where you you put all those excellent libraries that you grab from the community?

skirtle
24 Oct 2011, 9:54 AM
Personally I don't like to group community UXs in with Sencha code, it gives them a credibility they don't necessarily deserve. I'd usually only put the official Sencha UXs in with the library.

Picking a home for the community UXs is tricky. This is a situation compounded by the bizarre way UXs are all bundled into the Ext.ux namespace rather than being namespaced to the organization that created them. Most of my apps use very few community UXs so I can usually just shove them in a ux directory (separate from all Sencha code) but I don't feel that would necessarily scale as the number of community UXs grows.

dawesi
24 Oct 2011, 4:45 PM
@skirtle, thanks for your reply... as you can see above, I try to keep any non-bundled ux's out of the main build directories to keep it clean, and then I can roll the next version and not have to move the files, I'm just curious how other people do it. I also put different versions (or builds) of the ux's in their own directories ( aka build 23432 or version0.2 ).

I point a virtual directories 'latest' and 'stable' within each version directory (ie version4 for extjs) so that I can just point to /lib/jsframeworks/sencha/extjs/version4/stable so that you can roll a new version by simply changing the virtual directory location pointer, or if I want a specific version I can also just put that instead of 'stable'. the naming conventions for each of the zip downloads is unconventional which doesn't help. ( eg: sench-touch-1.0, extjs-4.0.6 - should either be sencha-extjs-x or touch-x for consistancy )

Just wondered if what I'm doing is considered 'good' practice or not so good. (main intent)

bt_bruno
25 Oct 2011, 5:07 PM
Hi @dawesi! I generally keep these ux into app/ux. If you read the Getting Started Guide (http://docs.sencha.com/ext-js/4-0/#!/guide/getting_started) you will notice that the app folder is used for a namespaced source code structure.


- appname
- app
- namespace
- Class1.js
- Class2.js
- ...


If your using the MVC architecture, you have models, views, controlers and stores, added into /app, representing the namespaces.

Given that, I do something like this at the top of my app.js:


Ext.Loader.setPath('Ext.ux', 'app/ux');

I don't really think that /app is a folder only for keeping the MVC folder structure. Whenever I need to create new namespaces as MyApp.util, or MyApp.helper, I create a folder into /app.

/extjs wouldn't be a good place, and other than this one, I guess /app would fit perfectly.