IE9 Screenshot Leaked

My World 30 August 2010 | 0 Comments

The new interface of much waited Internet Explorer 9 has been revealed following an article which was published by one of Microsoft’s Russian subsidiaries. Though it was removed quickly, but it was too late. [...]

Tagged in

Creational Patterns – Abstract Factory Pattern

Abstract factory pattern,Creational pattern,Design Patterns 9 August 2010 | 0 Comments

Today we are going to see one of the design patterns abstract factory. Its one level of abstraction higher than factory pattern.The main use of Abstract Factory Patten is that is isolates the concrete classes which are generated. [...]

Tagged in

Singletons in Java

Creational pattern,Design Patterns,JAVA/J2EE,Singleton pattern 16 July 2010 | 0 Comments

Singletons are the design pattern when you want only one instance of a class created. You make the constructor private, and give access to the instantiated object via a static instance method that creates the object if it has not been created already.
The singleton class is threadsafe lazy instantiation. I hope many would be knowing on lazy instantiation. With lazy instantiation, a program refrains from creating certain resources until the resource is first needed — freeing valuable memory space. In lame man words, loading the resource only when its needed.
[codesyntax lang="java5"]
public class YourSingletonClass{
private static YourSingletonClassinstance = new YourSingletonClass();
public static YourSingletonClass getInstance(){
return instance;
}
private YourSingletonClass(){
}
}
[/codesyntax]
How do we ensure only one the same instance is returned?

We write a public static getter or access method to get the instance of the Singleton Object at runtime. First time the object is created inside this method as it is null. Subsequent calls to this method returns the same object created as the object is globally declared (private) and the hence the same referenced object is returned.

Creating flex components in runtime using XML

ActionScript 3.0,Adobe Flex 18 May 2010 | 0 Comments

Creating flex components in runtime using XML

Today i was going through an requirement on how to create components in runtime where we have parse an XML as input and then create components in the stage. [...]

Tagged in

UPDATE and INSERT differences in syntax is an inconvenience

PHP,Programming 8 May 2010 | 1 Comment

UPDATE and INSERT differences in syntax is an inconvenience

An associative array is the conventional workaround of the coding world.. In an associative array, we can associate any key or index we want with each value. [...]

Tagged in , , ,

Design Patterns : Singleton Pattern

ActionScript 3.0,Design Patterns 15 April 2010 | 1 Comment

Design Patterns : Singleton Pattern

The Singleton pattern is very similar to creator pattern. This is very widely used pattern. Now a question might raise in the mind that why do we need this pattern and when it should be applied. Let us take a situation where you want to build a chess game. Where does the Singleton Pattern apply here? [...]

Tagged in , , , ,