MVC


Bringing Sanity to Javascript apps

GARBAGE


WTF ? Sane ?

MVC ?

Advantages

Separation of concern, Modularity, Reusability, Maintable, Testable

Why do we need it on client side?

Complex single page applications

Separating data, presentations and behaviour

Google Search

How would you implement it?

Goal

Event driven, Loosely coupled, Independent components

Deconstructing MVC

on client side

Model

Holds data, Server Communication, Validation of data

View

Visual representation of application data/info

Controller

Commander-in-chief

MVC*

Customized MVC resulted in MVVM, MVP, MV* frameworks

Frameworks

  • BackboneJs
  • AngularJs
  • EmberJs
  • SpineJs
  • KnockoutJs
  • CanJs
  • SammyJs
  • more ....

Framework

Application Structuring, Predefined way of development, Common tasks

Avoids common mistakes done in day to day dev

BackboneJs

MV*

5 Main Classes

Simple

Flexible

Can be used in parts

Backbone Model

Backbone View

Backbone Collection

Backbone Router

Backbone Events

Rethinking Google Search in MVC

Demo

Infinite Scroll using BackboneJs

Thanks & Questions