bob.js JavaScript Framework

Official Website: www.bobjs.com


Object Oriented
Best OO practices, now in JavaScript
Perfect for JS Back-End
e.g. Objects with business logic
No Dependency on DOM
No direct call to Document Object Model
Also Works for DOM
DOM elements are objects as well
 

Top 3 Features You Need to See 

 

1. JavaScript Object Transformations (JSOT) 

From: To:
 
var from = {
    a: 'b',
    c: 'd'
};
 

 
var to = {
    b: 'a',
    d: 'c',
    e: 'f'
};
 
bob.js can transform:  
 
var to = bob.collections.extend(from)
    .toObject(
        function (prop, val) { return val; }, 
        function (prop, val) { return prop; })
    .combine({ e: 'f' })
    .getValue();
 
 
 
  

2. Named Arguments in Functions 

From passing optional nulls: 
 
var func = function (name, age, gender, shape, width, height) { ... };
...
func (null, null, null, 'Rectangle', 20, 30);
 
To passing named arguments: 
 
var func2 = function (objArgs) { ... };
...
func2 ({ shape: 'Rectangle', width: 20, height: 30 });
 
One line of code to go: 
var func2 = bob.fn.namedArgFunction(func);


3. JavaScript Namespaces 

Instead of boring coalescing checks: 
var myApp = myApp || {};
myApp.myFunctions = myApp.myFunctions || {};
myApp.myFunctions.say = function(msg) {
    console.log(msg);
};
...
var myApp = myApp || {};
myApp.myFunctions = myApp.myFunctions || {};
myApp.myFunctions.mySubFunctions = myApp.myFunctions.mySubFunctions || {};
myApp.myFunctions.mySubFunctions.hello = function(name) {
    myApp.myFunctions.say('Hello, ' + name);
};
...
myApp.myFunctions.mySubFunctions.hello('Tengiz');
 
Define clean namespaces: 
 
bob.ns.setNs('myApp.myFunctions', {
    say: function(msg) {
        console.log(msg);
    }
});
...
bob.ns.setNs('myApp.myFunctions.mySubFunctions', {
    hello: function(name) {
        myApp.myFunctions.say('Hello, ' + name);
    }
});
...
myApp.myFunctions.mySubFunctions.hello('Tengiz');
 
 
 

More Cool Features 

Unit Testing and Assertion Functions 

Module Dependency Tracking 

Collection Traversing and Manipulation Functions 

JavaScript Events 

Overload Functions 

Interface Extraction 

Read-Only and Write-Only Properties 

Observable Properties 

Object to String Conversion 

String Formatting 

Type Check and Coalescing Functions 

 
 

Discover Even More by Yourself - Download bob.js Today!

Last edited Jan 31, 2014 at 5:10 PM by ttutisani, version 25