User:Cxu223/sandbox

Chaplin.js is an open-source client-side JavaScript web framework based on the model–view–controller (MVC) software architectural pattern. Chaplin.js uses the Backbone.js library and is intended for developing single-page applications.

Development History
In February 2012, Chaplin.js was created by Mathias Schäfer as a result of a project to build Movie Pilot by 9elements. The ongoing maintenance and development is done by a team consisting of Mathias Schäfer, Paul Miller, Karel Ledru-Mathé, Ryan Leckey, Johannes Emerich and other contributors. As an open-source project, many people may contribute to the project. Some notable contributors are: Nico Hagenburger, Rin Räuber, Wojtek Gorecki, Jan Monschke, Jan Varwig, Patrick Schneider and Luis Merino.

The initial release of Chaplin.js was version 0.1.0 on February 26, 2012. Contributors and developers made subsequent releases to fix bugs and add new functionality. The latest release available of Chaplin.js is version 1.0.1, released on October 14th, 2015.

Architecture
The architecture of Chaplin.js uses the Backbone.js library, which uses the MVC pattern, and implements additional design patterns. It has the components of the MVC pattern (Model, View, Controller), as well the components: Application, Router, Dispatcher, Layout, Mediator, Collection and Collection View.



Application
This component is responsible for the initialization of other components. It will initialize the Layout, the Router, the Dispatcher and the Composer.

Router
This component is responsible for URL changes. It communicates with the Dispatcher to inform it when URL changes occurs.

Dispatcher
This component is responsible for listening to the Router and responding accordingly. It will get rid of the old Controller object, and create a new Controller object that can perform the required task.

Layout
This component controls the views of the application as well as managing the internal links. As new controllers are made by the Dispatcher, the Layout component changes the view to that of the new controller.

Features
Chaplin.js allows for use of CoffeeScript class hierarchies and object composition. It uses AMD modules for module encapsulation and lazy loading. Memory management is a main matter of interest, and proper object disposal is used. It uses design patterns - Mediator and Publish/Subscribe patterns in order to facilitate the communication across different modules. It allows for Rails-style routes which can map URLs to controller actions. It also allows the user to manage individual UI views with new controllers.

Memory Management
A large focus of Chaplin.js is on memory management and object disposal. The initial classes from Backbone.js, from which Chaplin.js is based off, are extended in order to properly dispose of the controllers, models, collections, and views. To manage memory, the current controller will use its "dispose" method before the takeover of a new controller. The "dispose" method will remove its DOM elements, remove the linking from DOM or model/collection events, and propagate the "dispose" method call down to its subviews.

Dependencies
Chaplin.js dependencies change depending on what is used with it. Using Backbone.js with Chaplin, Iodash/Underscore and JQuery/ Zepto are required. If Chaplin is used with AMD, RequireJS, Almond, or curl are needed. Exoskeleton, another framework, enables Chaplin to be used without dependencies when it is used.

Use
These are some examples of applications build using Chaplin :

Moviepilot
Moviepilot is a website that holds information and articles about upcoming movies. This website was the original site to be build using Chaplin.js. The framework was actually developed in order to build the website.

GED VIZ
GED VIZ is a tool that allows the user to build visual representations of the global economy.

Ost.io
Ost.io is a website that serves as a forum for projects on Github. It is made with Brunch and Rails as well as Chaplin.js.

Delicious
Delicious is a website that allows the user to keep track of links and access them later on. It is made with Brunch, Backbone, and Chaplin.js.

Dogkr
Dogkr is a website that allows the user to keep track of the moments of their dog's life.

Arena
Arena is a website that allows the user to research things collaborative. The user can put together information and combine it with other user's information and/or their own. The frontend of Arena was build using Chaplin.js.

Pentagon
Pentagon is a website that allows the user to research and compare product prices on the market. The webapp of Pentagon was made using Chaplin.js.