I am developing a web application. The application is becoming quite complex, to the extant I decided I've got to introduce some oop concepts.
The original js oop just isn't native enough for me (I am a .net developer), and its inheritance is awful. I came across http://moo4q.com/ which looks promising, but seems to be rather new. This is quite a risk for me.
What other oops frameworks are there, to enhance my jquery / js development?
EDIT 1
I am not looking for a framework to substitute jquery, I am looking for a framework to extend it.
thank you
An OO programming language must have objects, method, property, classes, encapsulation, aggregation, inheritance and polymorphism. You could implement all this points, but JavaScript has not them.
JavaScript is not a class-based object-oriented language. But it still has ways of using object oriented programming (OOP). In this tutorial, I'll explain OOP and show you how to use it. The most popular model of OOP is class-based.
jQuery's each() function is used to loop through each element of the target jQuery object — an object that contains one or more DOM elements, and exposes all jQuery functions. It's very useful for multi-element DOM manipulation, as well as iterating over arbitrary arrays and object properties.
One of the oldest JS frameworks is the Jquery. This framework has been around for over 12 years and it's still going strong. So, what is jQuery? jQuery is a fast and concise JavaScript Library created by John Resig in 2006 with a nice motto, Write less, do more.
check out this project:
https://github.com/pylover/joop
Example:
Namespace('bmw.Car');
Class('bmw.Car', {
maxSpeed : 200, // Prototype member
__init__ : function(color,cylindres) { // Constructor
this.speed = 0; // Instance Member
this.color = color;
this.cylindres = cylindres == undefined ? 4 : cylindres;
},
isRunning : function() { // Method
return this.speed > 0;
},
run : function(speed) {
this.speed = speed;
}
}).StaticMembers({
doors: 4, // Static field
createSuperClass: function(){ // Static method
return new this('gold',12);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With