Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.
Derk Norton edited this page Jan 25, 2019 · 41 revisions

The Bali Component Framework™

Components

WARNING: This project is still in its early stages and the classes and interfaces to the classes are likely to change.

Overview

The Bali Component Framework™ provides a foundation for the Bali Nebula™. It provides a rich JavaScript framework of elements and collections that can be used to capture structured information and processes. This information can then be captured in documents using Bali Document Notation™. The documents can later be imported back into the corresponding JavaScript components.

The Bali Component Framework™ is like JSON on steroids. It supports a much richer set of primitive types (13 in all) and collection types (6 in all) than JSON's five total types. It also provides powerful higher-level programming constructs that may integrate directly with the Bali Nebula™.

This project provides all of the JavaScript/NodeJS modules that are required to work with Bali components and Bali Document Notation™ strings.

Example Document

To whet your appetite here is a short example Bali document demonstrating some of the component types available from the Bali Document Notation™:

[
    $transactionId: #LYZ6PJ9GBABSF18MQMBSJDV7KAPV4MS7
    $timestamp: <2017-12-30T17:38:35.726>($city: "Madrid", $country: "Spain")
    $consumer: [
        $accountId: #SFNYCS6WTNCAVQ43DDS9HQJQX2A1XAPZ
        $email: <jane.smith@gmail.com>
    ]
    $merchant: [
        $accountId: #GYR0D0N7D7RGLAMM50TA7YYP9TRCYFF0
        $name: "Cool Deals R Us"
    ]
    $items: [
        [
            $name: "Hover Board"
            $version: v2.65
            $quantity: 1
            $price: 142.00($units: $USD)
        ]
        [
            $name: "Hover Battery Packs"
            $version: v15.3.7
            $quantity: 2
            $price: 16.00($units: $USD)
        ]
    ]
    $tax: 10.77($units: $EUR)
    $total: 184.77($units: $EUR)
]

The document itself is fairly straight forward. It captures the information associated with a payment from a consumer to a merchant. The example is overly simple but it should give you the gist of the power behind the Bali Component Framework™ and its associated Bali Document Notation™.

Framework Classes

Each of the structures and attributes within the example document maps to a Bali component class within the Bali Component Framework™. The classes are grouped by type. Click on each type for details about specific framework classes of that type:

  • Elements - Elemental components that are generally considered atomic in nature without any subcomponents.
  • Composites - Components that are composed of subcomponents.
  • Collections - Composite components that contain a group of subcomponents that can be added and removed from the collection dynamically.

Getting Started

To install the NodeJS package for this project, execute the following command:

npm install bali-component-framework

Then add the following line to your NodeJS modules:

const bali = require('bali-component-framework);

Check out the example code here.

Contributing

Project contributors are always welcome. Create a fork of the project and add cool new things to the framework. When you are ready to contribute the changes create a subsequent "pull request". Any questions and comments can be sent to craterdog@gmail.com.