Archive for 'Javascript'

javascript, prototypes and object references

Posted by:

If you are using OOP, you are familiar with initializing class members in the head of the source:

/**
 * Pseudocode
 */
class Foo {
    int i = 0;
    Array bar = new Array();
}

However, if you are using Javascript’s prototypying, assigning objects to class (prototype) members will result in static instance variables.

Example:

teaching javascript the concept of interfaces

Posted by:

There’s an easy way to simulate Interfaces in Javascript, this post shows you how it is done.

(Beware, I’m going to mix OO terms in this posts a little bit for the sake of Javascript, but readers familiar with OO concepts will understand what I mean.)

At first we will extend Javascript’s native Object with a method called __implements, which is responsible for comparing class-methods with method-stubs (declared as strings) in an “interface” (quoted, because it is not an Continue Reading →

1

fighting the spill

Posted by:

More than a year ago I was digging deep in the sources of the Java-like GNU Classpath, trying to find a way to adopt the MVC Pattern they are using. Despite all the hassle with translating and substituting objects, methods and functionality (have you ever taken a look at the ...

Continue Reading →
1

there is no spill! there is no spill!

Posted by:

I bet most of you know those days where hacking your software goes just fine until you expect a minor feature to cause huge problems. It happened to me on saturday when I wrote the layout manager for my javascript empowered table widget. The architecture will be similar to JTable found in the Java/GNU Classpath API – their idea of the separation between the data model and the view/controller is easy to understand, yet powerful.
Since working with ...

Continue Reading →
1