Tuesday, June 15, 2010

WebWorker - Simulate Javascript Multi-thread

We survive with SINGLE THREAD Javascript.

Time has come to have parallel programming in client side with Web workers.

With family of HTML 5 products, we have web workers, which will allow to run another thread in browser which will not impact user interactions.

Wiki
Spec
More

Wednesday, December 16, 2009

Host file in XP

c:\windows\system32\drivers\etc\hosts

Saturday, November 28, 2009

Google Wave

Google Wave is an online tool for real-time communication and collaboration. A wave can be both a conversation and a document where people can discuss and work together using richly formatted text, photos, videos, maps, and more.

http://wave.google.com/

Currently new accounts are allowed with invitations.

Go - New Programming Language from Google



Tutorials:
http://golang.org/doc/go_tutorial.html

Sunday, October 18, 2009

Singletons are Global state: Use wisely

We had an opportunity to write unit test cases for some legacy code and it was tough job. Find it very difficult especially when so much singletons are used on code base.

We should really use it only when its required. The following article forces that.

Refer:
http://www.ibm.com/developerworks/webservices/library/co-single.html

Google has singleton detector for sometime now, that can be very useful if you need to analyze the code base without source code.

Refer:
http://code.google.com/p/google-singleton-detector/

Law of Demeter and violations.

Law of Demeter - "Only talk to your immediate friends"
An object should avoid invoking methods of a member object returned by another method. In Java,the law can be stated simply as "use only one dot". That is, the code "a.b.Method()" breaks the law where "a.Method()" does not.

Violations:
With the SOA applications rising up these days, its very difficult to draw a line to what extend one can violate this law.

One way to create appropriate facades to wrap the internal extensions, however it just looks like for the sack of the (LoD) Law of Demeter and in fact slows one down on development.

Lot of third party libraries does not seem to care about the principle at all.Everyday we use these libraries,needless to say with lot of dots,and when we get "NullPointerException", the deguggin goes crazy.

We should realize the value of LoD, at least from unit testing perspective and its very hard to test the piece of the code that violates the LoD to larger extend.

Strongly feel, developers or API Architects should take LoD into account when they design plugin/libraries.