Situations often will demand for the existence of only one object for a particular class in an Application. For example, the existence of only one Database Connection for a particular session, one object referencing the set of Global properties being shared across the various modules, etc. Such classes are candidates to be designated as Singleton [...]
Archive | August, 2007
Template method Pattern – Design Patterns in Java/J2EE
August 21, 2007
A Template method pattern provides a skeleton for performing any sort of algorithm or an operation, and it allows the sub-classes to re-define part of the logic. Let us directly get into an example to clarify things in a much better manner. For example, if we wish to write a String Decorator class, which decorates [...]
State Pattern – Design Patterns in Java/J2EE
August 21, 2007
State pattern falls under the category of Behavioural patterns. Assume that we have an object and its behavior is largely dependent on the state of its internal variables. Consider the following example, Person.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 package tips.pattern.state; [...]
Using the new Process Builder class
August 21, 2007
We all know how to execute programs from within a Java Application by making use of the Runtime Api. For example, assume that we want to launch the Internet Explorer browser within the Java code. Then the following code snippet will just do that, ProcessLauncher.java 1 2 3 4 5 6 7 8 9 10 [...]
HashCode and equals methods
August 21, 2007
HashTable, HashMap and HashSet are the Collection classes in java.util package that make use of hashing algorithm to store objects. In all these Collection classes except HashSet, objects are stored as key-value pairs. For the storage and the retrieval of any user-defined objects it is a good practice to override the following methods which is [...]
Expression Language in JSP 2.0
August 20, 2007
1)Introduction Expression Language was first introduced in JSTL 1.0 (JSP Standard Tag Library ). Before the introduction of JSTL, scriptlets were used to manipulate application data.JSTL introduced the concept of an expression language (EL) which simplified the page development by providing standerd tag libraries. These tag libraries provide support for common, structural tasks, such as: [...]
What is UDDI?
August 14, 2007
Introduction Welcome to the future of Internet-based application development and deployment. This article will give us an idea about Universal, Description, Discovery and Integration (UDDI). What is it ? Why it is an important in the future of Web services standards ? This article explains that UDDI is focused on sharing business information, making it [...]
Generics in Java 5.0
August 14, 2007
1) Introduction The feature of Generics in Java allows Applications to create classes and objects that can operate on any defined types. Programmers can now make use of the Generics feature for a much better code. There is no need for un-necessary casting when dealing with Objects in a Collection. This article provides a detailed [...]
New Features in Java 5.0
August 14, 2007
1) Introduction Java 5.0 comes with a bunch of useful features. In this article, we are going to have an overview of the features like Enhanced for-loop, Variable Arguments, Static Imports and Enumerations. Apart from these features, we have already published other notable features in Java 5.0, auto boxing, generics and annotations. Buy generics book [...]
AutoBoxing in Java 5.0
August 12, 2007
1)Introduction In the latest version of J2SE 5.0 released by Sun, Autoboxing is one of the new feature. Before J2SE 5.0, working with primitive types required the repetitive work of converting the primitive types into wrapper classes and vice – versa. Sometimes the purpose of conversion is just for some API call, after which the [...]






August 21, 2007
3 Comments