Define the collection. The primary argument will be the type of Collection. i.e. A book, Which makes this collection a library entity.

var Library = Backbone.Collection.extend({
model:Book
});

Reusable Book view. We Define a book view consisting of the following items 1. A tagName - The holder, can be anything/Div is default 2. A className - Optional 3. Template - To render the UI from 4. render() - The magic logic.

The Controller/Router - Lets define some routes, one to view all the books in library and one to view a selected book.

var LibraryRouter = Backbone.Router.extend({

ex url: <scheme>://<host>:<port>/<path>&<parameters>?<query>#<fragment> '' If nothing is present as part of the fragment/Query, we show the complete library 'View/:id' : Match any route that has a 'View' as part of the fragment and anything after that as ID