Skip to content
/ armjs Public

one javascript mvc framework for enterprise application

License

Notifications You must be signed in to change notification settings

jarry/armjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArmJS

Description:

A lightweight, object-oriented JS framework for quickly creating clearly and structured web applications.

  1. basic objects type: HashMap, ArrayList, Model
  2. built-in objects: Module, Util, Config, Action, Dao, Class, View
  3. create objects
  4. run action

npm install

$ npm i armjs2

see npm: armjs2

import 或 require

example usage arm-example

basic data object

basic data object

Action -> View -> Class -> Dao -> Model
    
Module, defined module info
Action,  control some Object and instancing Class, View
View, DOM process and Event bind
Class, JSON parse, and service logic
Dao, ajax request
Model, JSON object or Object-Class
Config, JSON object, module config
Util, JSON object, static method list

usage

create object

create Module

    var Module = Arm.create('Module', {
        name: 'Module',
        SubModule: {}
    });

create Action

    Module.Action = Arm.create('Action', {
        name: 'Module.Action'
    });

create View

    Module.View = Arm.create('View', {
        name: 'Module.View',
        element: document,
        properties: {
        
        },
        options: {
        
        }
    });

    // XView
    Module.XView = Arm.create('View', {
        name: 'Module.XView',
        element: document,
        properties: {
        },
        options: {
        }
    });

    // SubModule.View
    Module.SubModule.XView = Arm.create('View', {
        name: 'Module.SubModule.XView',
        element: document,
        properties: {
        },
        options: {
        }
    });

create Class

    Module.Class = Arm.create('Class', {
        name: 'Module.Class',
        properties: {
        
        },
        options: {
        
        }
    });

    // XClass
    Module.XClass = Arm.create('Class', {
        name: 'Module.XClass',
        properties: {
        
        },
        options: {
        
        }
    });

    // SubModule.XClass
    SubModule.XClass = Arm.create('Class', {
        name: 'SubModule.XClass',
        properties: {
        
        },
        options: {
        
        }
        // hiherits from class 
    }).inherits(Module.XClass);

create Dao

    Module.Dao = Arm.create('Dao', {
        name: 'Module.Dao',
        getName: function(data, callback) {
            // ajax
        }
    });

    // XDao
    Module.XDao = Arm.create('Dao', {
        name: 'Module.XDao',
        // don no extend from Base module
        extendBase: false,
        getName: function(data, callback) {
            // ajax
        }
    }); 

use instance

    // extends
    Module.Action.get('Class').extend({});
    // run view
    Module.Action.run({});

    // TODO:

speical

tradition multi pages, such as struts of Java Web
also support one page, likes backbone

Example:

    see demo and test, require jQuery, jQuery Tmpl, and Qunit

development install && build

$ npm install
$ npm run build

About

one javascript mvc framework for enterprise application

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published