Friday, March 1, 2013

Backbone Frameworks Chaplin vs. Marionette

**UPDATE** Great comparion - Comparison of Marionette and Chaplin

Here are some thoughts I have had when comparing my experience with Chaplin and now starting to dig in to Marionette.

1. Module Initialization
- Marionette has each module register an initialization callback to the application in order to start it.

- Chaplin, I used a top down initialization approach where each composite object instantiated the modules and add them to
the el inside itself.

2. Regions and Layouts
Chaplin doesn't have a similar concept to this, it simply uses composite views.

- Marionette has the concept of a Layout which contains multiple regions

- Marionette introduces an application object that manages the transitions between my views. This object (aka Region) is solely responsible for managing the content of a specific DOM element, displaying what needs to be displayed and cleaning up anything that no longer needs to be there.

3. Controllers
Marionette doesn't use controllers anything like Chaplin,

instead Marionette uses Modules and the Backbone Router.

4. In General

Chaplin would say that all routes for an application would be one "routes files". Where as in Marionette you would put the individual routes needed for a module inside that module which would add them to a RouteManager.

In general this like the difference between organizing your code like one of the following two ways:

1.
  models
 
  collections
  views

2.
  modules
   house
    models
      FurnitureModel
    collections
    views
 
    FurnitureView
    FurnitureCollection



Talking about some of the design principles behind Marionette:
- http://lostechies.com/derickbailey/2011/12/12/composite-js-apps-regions-and-region-managers/

- http://lostechies.com/derickbailey/2011/11/17/introduction-to-composite-javascript-apps/

http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/

No comments:

Post a Comment