Posts Tagged ‘ java

Spring is totally losing its invisibility

Many of you might remember at the spring 1.2.X series there is a strong voice like:

easy,quick configurations and implementations with spring

Yes in fact that was totally true. It really used POJOs as bean containers. And it works really fine. While using these spring versions you did not usually need to make any import statements for any spring package/class/interface
sample classes below were shown as best practices: Read more

Grails, First Impressions

Grails
Image via Wikipedia

Since SpringSource acquires the Grails I was willing to test this framework and make a dummy project but first I should read some books:) Read more

java.util.Calendar.getInstance() // danger

An icon from gnome-themes-extras-0.9.0.tar.bz2...Image via Wikipedia

Do not use the method for in your frequently used methods.
instead of creating new instances use

Calendar.setTime(DATE)

otherwise each instance use lots of memory: 432 Bytes

UPDATED:

DO NOT USE LIKE THIS

while(condition){
Calendar calendar = Calendar.getInstance();
calendar.setTime(someDate)
int month = calendar.get(Calendar.MONTH);
}

USE LIKE THIS

Calendar calendar = Calendar.getInstance();
while(condition){
calendar.setTime(someDate)
int month = calendar.get(Calendar.MONTH);
}

ADD_MONTH vs add(Calendar.MONTH)

The FSF Trophy

I found it very interesting that these two methods are not working same :(

SELECT add_months(TO_DATE(’28-FEB-2007′), 1) FROM dual = 31-MAR-2007

while

java.util.Calendar c=..//28-FEB-2007
c.add(Calendar.MONTH,1); // gives 28-MAR-2007

which one is true ?
for the situation I am dealing java calculation is correct !

java vs Oracle and again winner is java !!!!

Runtime Java Stack

Toolkit

Image by Neil T via Flickr

I have been developing java application for more then 6 years. Most of these years I have used and evaluated open source projects. Here I’ll try to explain my open source java stack. Read more

maven profiles

Apache Maven

Image via Wikipedia

Maven profiles enable your pom to build your project with different build options .

Here I tried to overwrite some default configuration files with profile specific configuration Read more

Java7 Wish: Object/Bean Factory

One of the most critic point for java


return Class.forName(className).newInstance();

Upon since it seems this method bring the ultimate extensibility power to java.

But Now server & client applications became more and more complicated this feature became insufficient.

Read more