marionettejs/backbone.marionette — pull request #905 by jasonLaster (2014-02-09 23:37:36+00:00)
Title: Pass module classes directly to app.module

This is admittedly a small thing, but it would be nice to setup modules directly like this `app.module('Items', ItemModule)`.

As background, we're currently defining modules with `extend` and setting them up with an `app#module` options map. e.g.

```js
var ItemModule = Marionette.Module.extend({
startWithParent: false,
initialize: function(options) {},
onStart: function() {}
});

// ...

this.app.module('Items', {moduleClass: ItemModule});
```

It would be nice to setup modules more directly like this:
```js
var ItemModule = Marionette.Module.extend({
startWithParent: false,
initialize: function(options) {},
onStart: function() {}
});

// ...

this.app.module('Items', ItemModule);
```

This is not a big deal, but I think there are a couple benefits.
1. It's slightly nicer on the eyes
2. It makes it clear to the reader that the module functionality will come from the module class and not module option properties like `define` or `initialize`.
3. `Module.getClass` removes a small amout of duplication :)

cheers!