Using Prototype to call an Atlas enabled WebService

February 5, 2007

This blog has moved, and so has this post.

Javascript Singleton Part II

January 27, 2007

So I wrote that Singleton post a few weeks ago, and what it really turned into is how to initialize Static Properties. Though calling it a Singleton post really makes you look kind of silly, since its a piss poor example of that.

Here is the Class Diagram from Wikipedia for the Singleton Pattern


To break that down, we have a Public Instance Function that retrieves the singleton instance, and a private constructor so the object can only create itself.

In the example I gave earlier, you can’t have a private constructor, and you can still call the public constructor again after the singleton has been defined. I was really excited to see that the new Prototype 1.5 library that was released (maybe the old one too, I’m just starting to get into it) contains some classes such as the Position class that have no public constructor, and are available without having to construct them initally.

How did they do this I wondered. A quick dig into the library shows that Prototype just uses the inline object syntax, which makes the Position class just an object instance, which of course has no constructor.

var Position = { “Methods” : function() { /* */ } }

I really like this a lot better, and I’ll probably be utilizing it a bit more in the library for our companies product. I’d love to see more libraries out there that you can include and you would get these specialized functional classes. Prototype’s Position is really helpful, what else could we want?

What I’m reading

January 1, 2007

Its my New Years weekend vacation and I’m reading reading these juicy programming articles. Beware, full of naughty goodness.

AJAX Patterns – All about AJAX, quite helpfull.

43 Folders Wiki – Productivity wiki for the software development field.

Reflector Addins – Code Generation, Code Coverage, Code Graphs, man look at them all.

The Peoples Toolbox – Usefull tools for developers

0Rand 1, 0Rand 2 – Two great articles by this guy, Article 1, debuging with Reflector and Visual Studio, debug lower level components you don’t have source code for. Article two, debunking my statements that us developers need offices to be more productive.

WPF versus WPF/E – Interesting comparison with some sample code.

The Dojo Toolkit in Practice – Intro to Dojo

Superfoods everyone needs – Eat healthy!