Coder Social home page Coder Social logo

framework-factory's People

Contributors

aamironline avatar nomaan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

talhamaniar

framework-factory's Issues

Documentation

Framework factory documentation need to be completed.

Add a "callback" type handler

The new callback type handler should help define callback functions. The default value of callback members should be false,

var classA = myFramework.Class({
    onUpdate: myFramework.callback()
    update: function() {
        if (this.onUpdate) this.onUpdate();
    }
});

Usage:

var obj = new ClassA();
//registers callback
obj.onUpdate = function() {
    console.log("updated");
}
obj.update(); //prints updated.
obj.onUpdate = false; //unregisters callback.
obj.update(); //does nothing.

Add nodejs support

The current version of framework-factory doesn't support nodes. FrameworkFactory and its products should be available on both platform browser and nodejs.

Allow TypeHanlders to accept meta parametes

Its a good idea to allow type handlers to accept additional configuration parameter which can be later used as meta data for

var cls = myFramework.Class({
  //Second parameter in myFramework.attribute type-handler is meta parameter, 
  //that can be used to provide more information about this attribute.
  name : myFramework.attribute('no-name', {
    type: 'string'
  }
});

Create a Meta framework that let you query class members

Suppose an Employee is a class in myFramework, meta framework should let you query it.

For example

myFramework.Employee.getMember(memberName);
myFramework.Employee.getMembers(); //Returns all the members in the Employee class
myFramework.Employee.getAttributes(); //Returns all the attributes in the Employee class
myFramework.Employee.getProperties(); //Returns all the members in the Employee class
myFramework.Employee.getEvents(); //Returns all the members in the Employee class

Restructure Source and Grunt file

The current structure has some issues due to which FrameworkFactory is attached to the global object. For example in the case of browser environment, window.FrameworkFactory is accessible in the UMD mode.

Improve inheritance syntax

Currently a class can be inherited by passing base class constructor in the $f.Class function

myFramework.ExtendClass = myFramework.Class({
   // Initialization object.
}, myFramework.BaseClass);

This can be improved using extend function.

myFramework.ExtendClass = myFramework.BaseClass.extend({
   // Initialization object.
});

Make framework-factory.js main file.

Currently framework-factory.js is a scale-down version of framework-factory-x.js and does not support properties... Make it as main file and create new variation called framework-factory-legacy, this should not support properties.

Correct base class method invocation implementation.

Currently it supports base class' method invocation through this.base(...) member. This is good but it is only available in functions. Also technically it carries an overhead of creating and deleting this.base function at run time which is a terrific performance impactor.

The solution is to provide an always available this.base object in Class's prototype so that this can be invoked by any member. After implementation, resulting code should look like this...

//Old
var Abc = myFramework.Class({
  print: function print(message) {
    this.base(message);  //<- See this line
  }
};
//New
var Abc = myFramework.Class({
  print: function print(message) {
    this.base.print(message);  //<- See this line
  }
}

Finalize plugins

Following plugins need to be separated inside the plugins directory.

  • deep-copy
  • equal

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.