tags:

views:

2152

answers:

3

I have an old project that I'm resurrecting as it were, and it makes heavy use of a Javascript/moo tools event controller that I wrote, and also a few Javascript OOP components that I wrote. It's very heavily pattern and OOP based. Also the components are well decoupled.

Does jQuery have any features like these? And if so what are they?

Thank you, Andrew J. Leer

+1  A: 

jQuery uses a Plugin Architecture that is very useful for developing re-usable and de-coupled components. This pattern is very useful whether releasing code to the general public or for private projects.

Having said that, jQuery is also javascript! That means that you can use other javascript design patterns that integrate jQuery functionality.

jonstjohn
Right, I understand that you can use it along with mootools and several other frameworks, but I guess what I'm really asking is does it have it's own type of OOP support like mootools does?
leeand00
+2  A: 

jQuery is much more focused on a functional style of programming (like JavaScript itself). Personally I find that tacking on 'traditional' OOP features is ugly and pointless. There's plenty of ways to get the same benefits in JavaScript, look up it's prototype style of inheritance, for example.

In short, no :)

thenduks
@thenduks I'm aware of the OOP syntax for both mootools and plain old javascript prototype-based OOP. The MooTools OOP syntax is what led me to believe that jQuery might have something along those lines.I do traditional OOP features for maintainability/front-end team coordination.
leeand00
I suppose that's fair enough, but the answer to your question is still 'no'. jQuery encourages using the tools already provided by JavaScript (prototype-based) along with it's plugin architecture.
thenduks
Okay I'll take that answer.
leeand00
Exposing prototypal inheritance through a simple API is as worthy a goal as exposing the DOM's insanity through the jQuery api.My guess is you've never spent enough time in MooTools/Dojo/Prototype to realize the huge benefits of Classes, Sub-classes, and Mixins with JavaScript. No code is more beautiful than mutable, atomic chunks of code.
rpflo
+2  A: 

jQuery has no API that exposes prototypal inheritance the way it exposes the DOM.

Check out http://moo4q.com.

Moo4q provides a download that includes jQuery, 14k of MooTools for inheritence, and a Class mutator to automatically extend the jQuery prototype with your MooTools class. In other words, structure and organize your code with MooTools, manipulate the DOM with jQuery.

rpflo