Freja

From CSScripting

Freja is a specialized Javascript Framework for creating template-based, single-screen web applications.

Freja is:

  • Browser-centric and server-agnostic.
  • Aimed toward delivering zero-latency user interface.
  • Based on recognized standards and accepted best practices:
  • Open-Source and licensed under the CC-GNU LGPL.


The Freja core development team is comprised of Cedric Savarese and Troels Knak-Nielsen. Freja is built upon the Sarissa library by Manos Batsis.

For some background information, check out this post.


Contents

Model-View-Controller Implementation

Freja adopts the following conventions:

  • A Model holds application data in a DOM document. The Model provides the mechanisms to retrieve, manipulate and send data back to the server.
var myModel = getModel('/models/modeldata.xml');
  • A View contains elements of the user interface, as HTML code embedded in a XSL stylesheet. The view is rendered using a process called XSL Transformation.
var myView = getView('/views/view1.xsl');
  • The Controller is the application logic, and is for you to write. Freja provides the basic mechanisms to (1) render a view, (2) to update a model from a view containing a form and (3) to send the model back to the server. Respectively:
myView.render(myModel);
myModel.updateFrom(myView);
myModel.save();

Benefits

  • Geared toward single-screen, zero-latency web applications.
  • Excellent scalability (much less server round-trips).
  • True MVC separation.
  • True Server-side / Client-side code separation.
  • Very light footprint (as low as 34Kb). Only a handful of methods to learn.
  • Works with any modern web browser: IE, Firefox, Safari, Opera.
  • Offline capabilities.
  • Limited redundancy with other javascript toolkits and libraries (prototype, scriptaculous, dojo, etc..). Freja play well with other javascript libraries and framework.

Tutorials

Documentation

Download

Freja comes in two different builds:

  • minimal: contains the framework and all dependencies in one single file.
  • mochi+sarissa: contains the framework, but Mochikit and Sarissa must be loaded separately. This build is appropriate if you are already using Mochikit for your application.

Compressed versions (about 38Kb) are available in the SVN repository (in the lib folder).

Freja v2.1 SVN Repository


Server-side XSL Transformation Service (used when client-side XSLT is not available)

Project Resources


Mailing lists for the project:

Acknowledgments

Freja is based on the Sarissa project by Manos Batsis

Real World Applications