Introduction

There are many JavaScript libraries that are correctly and nicely implementing object-oriented approaches, but non of them provides these features only - for example, adding AJAX capabilities, DOM manipulation, ... -

jOOPL is here to offer object-oriented programming and no more, just a tiny, simple and effective library that is going to support your JavaScript developments in the Web and anywhere.

Why jOOPL?

Web development is going forward at the same speed as the Web does itself. Now this is an internet of applications and this fact is affecting complexity.

Currently object-oriented programming has proven along lot of years that is a productive, near to human mind and cost-effective way of implementing small to large software solutions and, now, in the Web 2.0 and 3.0 times, software applications are more than a Web page showing information since current evolving paradigm is cloud computing, which enables devices, services and programs to connect themselves over the network.

But object-oriented approach has evolved in Web servers and Web clients are somehow using old ways of doing things, excepting selected and famous JavaScript libraries.

That is why jOOPL is here: a small and simple, but yet powerful library that gives developers the power of creating classes, interfaces, take advantage of inheritance, polymorphism and encapsulation, in order to take the Web to the next level with re-usable, scalable, well-written and easy-to-understand custom JavaScript objects.

Code sample

Here is a sample usage of jOOPL demonstrating a simple inheritance: "C" class will print "Hello world!" by chaining "SayHello" method's implementations:

$namespace.register("jOOPL.Sample");

jOOPL.Sample.A = $class.declare
    (
// Constructor
        function (args) {
        },
// Methods
        {
        SayHello: function () {
            document.write("hello");
        }
    }
    );

jOOPL.Sample.B = $class.declare
    (
        function (args) {
        },
        {
            SayHello: function () {
                this.$base.SayHello();
                document.write(" world");
            }
        },
        jOOPL.Sample.A
    );

$namespace.alias(jOOPL.Sample, "Sample");

Sample.C = $class.declare
    (
        function (args) {
        },
        {
            SayHello: function () {
                this.$base.SayHello();
                document.write("!");
            }
        },
        jOOPL.Sample.B,
        jOOPL.Sample.IHelloable
    );

$namespace.using("jOOPL.Sample");

var instance = $new(C);
instance.SayHello();

Last edited Jan 24, 2013 at 1:56 PM by MFidemraizer, version 7