bruth/backbone-common — Issue #4: Use the same file/dir name pattern for cleaner namespaces
Author: bruth
Created: 2012-01-03 16:29:31+00:00
State: open

Modules can be defined as such:

```
# top-level module
common.coffee
common/

# import views/*.coffee in here
views.coffee
views/
collection.coffee
state.coffee

# import models/*.coffee in here
models.coffee
models/
polling.coffee
state.coffee
...
```

This then allows for importing at any level:

```javascript
require(['common/views'), function(Views) { ... }
```

or

```javascript
require(['common/views/state'], function(StateViews) { ... }
```

A file-base namespace will look like this:

```coffeescript
# views.coffee
define ['views/collection', 'views/state'], (Collection, State) ->
return { Collection, State }

# common.coffee
define ['views', 'models'], (Views, Models) ->
return { Views, Models }
```