docs: function Umecob(id) { // this function is meaningless. Just for making a scope.
    if (Umecob.instances[id]) {
      Umecob.log('id "'+ id + '" already exists. return the function (new function was not created.)');
      return Umecob.instances[id];
    }
  
    function umecob(params) {
      if (typeof params != 'object') {
        params = { 
         tpl_id: arguments[0] || '', 
         data: arguments[1] || {} , 
         sync: (typeof arguments[2] == 'boolean') ? arguments[2]: true};
      }
      return umecob[params.sync ? "sync" : "async"](params);
    }
  
    /* inherit static values */
    umecob.id = id || new Date().getTime().toString();
    umecob.Umecob = Umecob;
    umecob.version = Umecob.version;
    umecob.log = Umecob.log;
    umecob.scope = Umecob.scope;
    umecob.node = Umecob.node;
    umecob.Deferred = Umecob.Deferred;
    var Deferred = umecob.Deferred;
  
    umecob.use = function(setting, append) {
      return umecob.preset('plain', setting, append);
    }
  
    umecob.preset = function(name, setting, append) {
      if (setting == null) return umecob.preset.get(name);
      if (append !== false) append = true;
      if (typeof setting == 'string') setting = { binding: {tpl: setting, data: setting} };
      if (typeof setting.binding == 'string') setting.binding = {tpl: setting.binding, data: setting.binding};
      if (typeof setting.start == 'string') setting.start = [setting.start];
      if (typeof setting.end == 'string') setting.end = [setting.end];
      if (append && typeof umecob.preset.vals[name] == 'object') {
        umecob.preset.vals[name].binding = setting.binding || umecob.preset.vals[name].binding;
        umecob.preset.vals[name].compiler = setting.compiler || umecob.preset.vals[name].compiler;
        umecob.preset.vals[name].start = setting.start || umecob.preset.vals[name].start;
        umecob.preset.vals[name].end = setting.end || umecob.preset.vals[name].end;
        umecob.preset.vals[name].merge_start = setting.merge_start || false;
        umecob.preset.vals[name].merge_end = setting.merge_end || false;
      }
      else {
        umecob.preset.vals[name] = setting;
      }
      return umecob;
    }
  
    umecob.preset.push = function(type, name, fname) {
      if (typeof umecob.preset.vals[name] != 'object') return umecob;
      var arr = umecob.preset.vals[name][type] || [];
      arr.push(fname);
      umecob.preset.vals[name][type] = arr;
      return umecob;
    }
  
    umecob.preset.get = function(name) {
      return umecob.preset.vals[name];
    }
  
    /* default setting 'plain' */
    umecob.preset.vals = {
      plain : {
        binding  : {tpl: 'plain', data: 'plain'},
        compiler : 'standard',
        start    : [],
        end      : []
      }
    };
  
  
    (function(umecob) {
      umecob.binding  = Config('binding');
      umecob.compiler = Config('compiler');
      umecob.start = Config('start', true);
      umecob.end = Config('end', true);
  
      function Config(setting_name, is_arr) {
        var f = function() {
          switch (arguments.length) {
          default:
          case 1: 
            return f.get.apply(f, arguments);
          case 2: 
          case 3: 
            return f.register.apply(f, arguments);
          }
        }
        f.vals = {};
        f.register = function(name, value, use) { 
          if (use !== false) use = true;
          value._name = name;
          f.vals[name] = value;
          if (use) {
            if (is_arr) {
              umecob.preset.push(setting_name, 'plain', name);
            }
            else {
              umecob.preset.vals.plain[setting_name] = name;
            }
          }
          return umecob;
        }
        f.get = function(name) { return f.vals[name]; }
        f.remove = function(name) { delete f.vals[name]; return umecob;}
        return f;
      }
    })(umecob);
  
    /* execution */
    (function(umecob) {
      /* get binding */
      function btyp(binding, type) {
        if (!binding) return null;
        if (typeof binding == 'string') return umecob.binding(binding);
        if (binding[type]) return umecob.binding(binding[type]);
        return null;
      }
  
      /* get start | end */
      function arrset(arr, type) {
        if (arr == null) return null;
        if (typeof arr == 'string') {
          var f = umecob[type](arr);
          if (!f || typeof f != 'function') return null;
          return [f];
        }
        if (arr instanceof Array) {
          var l = arr.length;
          if (l == 0) return [];
          var ret = [];
          for (var i=0; i < l; i++) {
            var f = umecob[type]( arr[i] );
            if (f && typeof f == 'function') ret.push(f);
          }
          return ret;
        }
        return null;
      }
  
      /* merge array */
      function merge(arr1, arr2, arr3, m1, m2) {
        return _m(arr1, _m(arr2, arr3, m2), m1) || [];
  
        function _m(a1, a2, m) {
          if (!m) return a1 || a2;
          switch (m) {
          case 'pre':
          default:
            return _mg(a1, a2);
          case 'post':
            return _mg(a2, a1);
          }
        }
        function _mg(a, name_a) {
          var names = [];
          var ret = [];
          for (var i in name_a) {
            ret.push(name_a[i]);
            names.push(name_a[i]._name);
          }
          for (var i in a) {
            if (names.indexOf(a[i]._name) < 0) {
              ret.push(a[i]);
            }
          }
          return ret;
        }
      }
  
      /* get current setting */
      function get_current_setting(params) {
        var configs = {};
        var local  = params.use || {};
        local = (typeof local == 'string') ? {binding: local} : local;
        var preset = (typeof params.preset == 'string') ? umecob.preset.vals[params.preset] : {};
        if (!preset) {
          Umecob.log('preset "'+params.preset+'" does not exist');
          preset = {};
        }
        var plain  = umecob.preset.vals.plain;
  
        configs.binding_tpl  = btyp(local.binding, 'tpl') || btyp(preset.binding, 'tpl') || btyp(plain.binding, 'tpl');
        configs.binding_data = btyp(local.binding, 'data') || btyp(preset.binding, 'data') || btyp(plain.binding, 'data');
        configs.compiler     = umecob.compiler(local.compiler) || umecob.compiler(preset.compiler) || umecob.compiler(plain.compiler);
        configs.start        = merge(arrset(local.start, 'start'), arrset(preset.start, 'start'), arrset(plain.start, 'start'), local.merge_start, preset.merge_start);
        configs.end          = merge(arrset(local.end, 'end'), arrset(preset.end, 'end'), arrset(plain.end, 'end'), local.merge_end, preset.merge_end);
        return configs;
      }
  
      /* prepare current setting and execute start functions */
      function common_start(params) {
        params.umecob = params.umecob || umecob;
        var configs = get_current_setting(params);
        /* execute start functions */
        for (var i in configs.start) {
          configs.start[i].call(configs, params);
        }
        return configs;
      }
  
      /* compile code and execute end functions */
      function common_end(params, configs) {
        params.code = params.code || configs.compiler.compile(params);
        if (typeof params.attach == "object") {
          for (var i in params.attach) {
            params.data[i] = params.attach[i];
          }
        } else if (typeof params.attach == "function") {
          var ret = params.attach(params.data);
          params.data = (ret) ? ret : params.data;
        }
        params.result = params.result || configs.compiler.run(params);
        /* execute end functions */
        for (var i in configs.end) {
          configs.end[i].call(configs, params);
        }
        return params.result;
      }
  
      /* synchronous call */
      umecob.sync = function(params) {
        params.sync  = true;
        params.async = false;
        try {
          var configs = common_start(params);
          params.tpl    = params.tpl || configs.binding_tpl.getTemplate.sync(params.tpl_id);
          params.data   = params.data || ( (params.data_id) ? configs.binding_data.getData.sync(params.data_id) : {});
          return common_end(params, configs);
        } catch (e) {
          umecob.log(e.stack || e.message || e);
          umecob.log(Umecob.Error.notice("UMECOB_SET_NAME", params.name));
          return e;
        }
      }
  
      /* asynchronous call */
      umecob.async = function(params) {
        if (typeof Deferred != "function") throw Umecob.Error("DEFERRED_NOTFOUND");
        params.async = true;
        params.sync  = false;
        var configs = common_start(params);
        return Deferred.parallel({
          tpl: ( params.tpl || params.code || params.result)
            ? (params.tpl instanceof Deferred)
              ? params.tpl
              : Deferred.call(function(){return params.tpl})
            : configs.binding_tpl.getTemplate.async(params.tpl_id),
  
          data: params.data 
            ? (params.data instanceof Deferred)
              ? params.data
              : Deferred.call(function(){return params.data})
            : (params.data_id) 
              ? configs.binding_data.getData.async(params.data_id)
              : Deferred.call(function(){return {} })
        })
        .next( function(val) {
          params.tpl    = val.tpl;
          params.data   = val.data || {};
          return common_end(params, configs);
        }).
        error( function(e) {
          umecob.log(e.stack || e.message || e);
          umecob.log(Umecob.Error.notice("UMECOB_SET_NAME", params.name));
          return Deferred.call(function(){ return e;});
        });
      }
    })(umecob);
  
    /* add bindings */
    umecob.binding('plain',  Umecob.binding.plain, false);
    umecob.binding('jquery', Umecob.binding.jquery, false);
    umecob.binding('xhr',    Umecob.binding.xhr, false);
    umecob.binding('file',   Umecob.binding.file, false);
    umecob.binding('url',    Umecob.binding.url, false);
  
  
    /* add compilers */
    umecob.compiler('plain', Umecob.compiler.plain, false); // mock
  
    umecob.compiler('standard', Umecob.compiler('[','%',  '%',']'), false);
    umecob.compiler('php', Umecob.compiler('<','?',  '?','>'), false);
    umecob.compiler('jsp', Umecob.compiler('<','%',  '%','>'), false);
  
    /* add end functions */
    umecob.end('logging', Umecob.end.logging, false);
  
    /* add preset */
    umecob.preset('debug', {end: 'logging'});
  
    Umecob.instances[umecob.id] = umecob;
    return umecob;
  
  }