Skip to content
Rémi Barraquand edited this page May 21, 2014 · 6 revisions

General discussion about Dahu v0.4

Goals

  1. Improve the project architecture:
  • better project subdivision
  1. Improve the software architecture:
  • improve drivers
  • improve JavaFx <-> JavaScript isolation
  • migrate backend to BackboneJS
  • migrate frontend to DeckJS
  1. Improve the edition :: check issues tracker
  2. Improve the export :: check issues tracker

Project Architecture

The project should be divided into the following components (sub-project):

  • driver
  • common
  • core
  • editor
  • cli (Command Line Interface)

The project architecture should look as follow:

<dahu>
├── build.gradle
├── driver
│   ├── build.gradle
│   ├── src
├── common
│   ├── build.gradle
│   ├── src
├── core (only js, html, scss)
│   ├── build.gradle
│   ├── app
|   |   ├── app.html
|   |   ├── components
|   |   ├── scripts
│   │   │   ├── dahuapp.js
│   │   │   ├── dahubridge.js
│   │   │   ├── configs
│   │   │   ├── modules
│   │   │   │   ├── module1.js
│   │   │   │   └── module2.js
│   │   │   ├── models
│   │   │   │   ├── model1.js
│   │   │   │   └── model2.js
│   │   │   ├── collections
│   │   │   │    ├── collections1.js
│   │   │   │    └── collections2.js
│   │   │   ├── views
│   │   │   │   ├── view1.js
│   │   │   │   └── view2.js
│   │   │   ├── controllers
│   │   │   │   ├── controller1.js
│   │   │   │   └── controller2.js
|   |   ├── styles
│   │   │   │   └── app.scss
├── editor
│   ├── build.gradle
│   ├── src
├── CHANGELOG
├── COPYING
└── LICENSE

Driver

Drivers are Java utilities to export low level functionalities to the Core module. Among the drivers we find:

  • filesystem
  • logger
  • keyboard
  • mouse

Drivers must not contain graphic user interface: no JavaFX in here.

Core

Dahuapp

The Dahuapp provides the user interface for building Dahu presentation/screencast. The code should be portable to be executed in different environment (JavaFx, server), it is therefore only written in JavaScript (Backbone, Handlebar, Underscore, etc.) and CSS.

Dahubridge

The Dahubridge exposes the Dahu compiler API. The compiler compile a file.dahu into a viewable presentation. The output can be a single html file or a html,css,js triplet. The compiler will be written in pure JavaScript to be integrated with the CLI and the editor.

Editor

The Editor is the JavaFx User Interface in which is executed Dahuapp. In order for the Dahuapp to run in the JavaFx Webview, the editor provides kernel modules that expose additional functionalities to the JavaScript API. The kernel is composed of many kernel modules. Each kernel module uses drivers from the Driver project.

CLI

The CLI provide a full command line interface to the compiler. The CLI must follow conventions used for decades in help messages and man pages. In order to define the interface for the CLI and automatically generate parser for it we will use the awesome http://docopt.org/

A first implementation of the CLI will be written in Java and will use:

Software Architecture

Backend

The backend is located in the core project.

Currently the backend is written from scratch using JQuery and is dirty... Also it cannot be executed in nonDOM environment (such as on server side like NodeJS or in engine like Nashorn). One of the main task of this v0.4 release is to migrate to BackboneJS.

Backbone is really lightweight and simple to use. The main objective here is to better organise the backend architecture with a clear separation between controller/view/model. While Backbone is powerful it can benefit from extensions that we will use such as:

  • Backbone.Marionette which provides required extensions such as Layout and nested views, Controllers, etc. Advantages of using Marionette are many, some of them are listed on the project page: https://github.com/marionettejs/backbone.marionette.
  • Backbone.Wreqr which provide a simple infrastructure for decoupling Backbone and Backbone.Marionette application modules and components. It includes support for message passing (events, commands, etc.)

Notes:

to be continued ...

Frontend

The frontend is responsible of rendering a Dahu presentation.

Currently the frontend is also written from scratch and is limited. One of the main task of this v0.4 release is to migrate to DeckJS.

DeckJS has become the reference tool for building HTML5 presentation. DeckJS already provides the framework to play a Dahu presentation/screencast.

Instead of developing our own stuff we will use DeckJS and contribute to it if functionalities are missing.

to be continued ...

Software Architecture Components

Drivers

  • Drivers are classes with static methods.
  • Drivers are never instantiated.
  • Drivers are generic and abstract low level system functionalities.

Kernel Modules

  • Kernel modules are instantiated and loaded in the kernel.
  • Kernel modules use drivers and expose the API used on the JavaScript side.

Kernel

Both the CLI and the Editor have to provide a Kernel for the Dahubridge/Dahuapp to run.

Libraries

  • Backbone (for architecture: models, collections)
  • Backbone.Marionette (for architecture: layouts, controllers, region, etc.)
  • Backbone.Wreqr (for decoupling architecture: message passing)
  • Underscore (for advanced JavaScript)
  • Handlebar (for templates)
  • RequireJS and Almond (for AMD)
  • JQuery (should be used only in view)
  • Cheerio (for HTML manipulation in nonDOM engine)
  • Grunt for building