Jump to content

User:Cxu223/sandbox

From Wikipedia, the free encyclopedia
Chaplin.js
Original author(s)Mathias Schäfer
Developer(s)Mathias Schäfer, Paul Miller, Karel Ledru-Mathé, Ryan Leckey, Johannes Emerich and other contributors
Initial releaseFebruary 26th, 2012
Stable release
1.1.0 / October 29th, 2015
Repositoryhttps://github.com/chaplinjs/chaplin
Written inJavascript
Operating systemCross-platform
Websitehttp://chaplinjs.org/

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.

History[edit]

Development History[edit]

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[1].

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[2].

Overviewc[edit]

Architecture[edit]

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.[3]

The image demonstrates the life cycle of an application built with Chaplin.js.

Application[edit]

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

Router[edit]

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

Dispatcher[edit]

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[edit]

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[edit]

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.[4]

Memory Management[edit]

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. [5]

Dependencies[edit]

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.[4]

Use[edit]

These are some examples of applications build using Chaplin [6]:

Moviepilot[edit]

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[edit]

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

Ost.io[edit]

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[edit]

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[edit]

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

Arena[edit]

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[edit]

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.

External Links[edit]

http://stackoverflow.com/tags/chaplinjs/info

http://chaplinjs.org/

http://docs.chaplinjs.org/

https://github.com/chaplinjs/chaplin

References[edit]

  1. ^ "chaplinjs/chaplin". GitHub. Retrieved 2016-12-06.
  2. ^ "chaplinjs/chaplin". GitHub. Retrieved 2016-12-06.
  3. ^ "Chaplin Documentation · Chaplin Documentation". docs.chaplinjs.org. Retrieved 2016-12-06.
  4. ^ a b "Chaplin | HTML5 application architecture". chaplinjs.org. Retrieved 2016-12-06.
  5. ^ "Memory Management and Object Disposal · Chaplin Documentation". docs.chaplinjs.org. Retrieved 2016-12-06.
  6. ^ "Chaplin | HTML5 application architecture". chaplinjs.org. Retrieved 2016-12-06.