Introduction

Getting started with Falcon with a simple Hello World application.

Dependencies

Falcon's only dependency is Knockout 3.0.0+

Download Knockout 3.1.0

Installation

Installing Falcon is as simple as including Falcon and Knockout and then running the Falcon.apply(); method to initialize your app.

 1 <!DOCTYPE html>
 2 <html>
 3 	<head>
 4 		<script src="knockout-3.1.0.js"></script>
 5 		<script src="falcon.min.js"></script>
 6 
 7 		<script>
 8 			var HelloWorldView = Falcon.View.extend({
 9 				url: "#hello_world-tmpl"
10 			});
11 
12 			//Apply only needs to be called once to initialize the app
13 			Falcon.apply( new HelloWorldView );
14 		</script>
15 	</head>
16 	<body></body>
17 	<template id="hello_world-tmpl">
18 		Hello World!
19 	</template>
20 </html>
Here we have a basic HelloWorldView that will be injected into the body tag of the document when the page loads.

By default, Falcon does not assume how you would like to communicate with your backend data source. Instead, you must include or write your own Falcon.Adapter. Falcon.Adapter defines the 'glue' between your front-end application and how it sends data to and receives data from a backend data source. You can go see a List of Adapters to find already implemented adapters.

 1 <!DOCTYPE html>
 2 <html>
 3 	<head>
 4 		<script src="knockout-3.1.0.js"></script>
 5 		<script src="falcon.min.js"></script>
 6 		
 7 		<script src="jquery-2.1.0.min.js"></script>
 8 		<script src="falcon.jquery_adapter.min.js"></script>
 9 	</head>
10 </html>
Example application that uses the jQuery adapter to communicate with a backend server via jQuery's ajax methods.
Motivations

Falcon was created to help organize small to large scale single-page javascript applications. Anyone who's work with Javascript and any number of libraries knows how tough it can be to visualize, organize, and execute a well-written, maintanable, and still flexible application. In other words, it's tough to organize javascript applications in a sensible and scalable way. Falcon's goal is to aid this problem by utilizing Knockout's awesome data-binding implementation with some basic constructs to help organize web applications.

Beliefs discerning between design logic and application logic

Falcon was designed with a few beliefs in mind:

Architecture Diagram