JSINER (originated from JavaScript INheritance supportER) represents a JavaScript
library intended to simplify writing object oriented code in as well as managing script dependencies.
Unlike of "classical" approach, it represents a "Lazy inheritance" because reference to parent class is invoked only at
the moment of object instance creation.
Basically, it's possible to say that instances of objects in such approach are created in "mixed" mode — on
first invocation, an appropriate factory is used to modify object constructor prototype which is later used for
subsequent object instances creation.
Moreover, since "Lazy inheritance" is called only once at the moment of first object instance creation, it
becomes possible to combine process of class prototype creation with resolving necessary dependencies of that
class. In other words, the process of prototype construction also allows loading scripts (if ones were not
loaded before) which particular class depends on.
Such approach to inheritance support has the following benefits:
"Lazy inheritance" has the same benefits as classical JavaScript prototype features;
It is not necessary to maintain proper order of script files declaration (contrary to "classical
inheritance");
In most cases, HTML page which contains JavaScript based on JSINER is loaded faster since there are no
objects created during page initialization (contrary to prototypal and classical approach) and since some
scripts could be loaded only at the moment in which they are actually necessary (they are necessary if the
caller code during it's execution really creates instances of corresponding classes);
Dependencies are declared in more explicit way and class depends only on concrete scripts; Moreover, it's
not necessary to artificially group particular scripts into "modules" and define dependencies between such
"modules";
If lazy mode of scripts loading is used, only necessary scripts (which are actually required for application
functionality) will be loaded. If, for example, some HTML page may operate in different modes, like
"read-write" and "read-only", for every mode required scripts will be loaded and this will be performed
automatically without manual script loading optimization;
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at Apache License 2.0 license.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distribution
JSINER distribution includes:
Fully documented JSINER code.
The documentation is specific to a version of the JSINER.
Examples - html contains JSONER usage cases examples.