Code Monkey home page Code Monkey logo

armjs's Introduction

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

armjs's People

Contributors

jarry avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.