Archive for December, 2009

What’s wrong with JavaEE

I actually prefer using Spring and Hibernate. I call it Hibernating in Spring. I have never used JSF, I don’t use JPA, entities are a foreign word(may be alien is better) etc etc. So my knowledge of JavaEE was basically as much as will aid me in Hibernating in Spring.

From JavaEE 5, I decided to read the JavaEE tutorial, I was actually reading it when JavaEE 6 was realeased with Netbeans 6.8. I downloaded both and also downloaded the Java EE Toturial, Volume 1. I read this too. After then I asked myself, what’s wrong with JavaEE?

I mean what’s wrong like why do we need frameworks like struts, wicket, spring, etc etc. The JavaEE stack I believe is matured enough to handle all your needs. I really don’t know how JavaEE was before 5, but since 5, and now 6…..JavaEE is the bomb.

Now we have Facelets – I wonder what can be better than that. JPA, Transactions etc etc. Just for the fact that I hate XML and that the compiler can take care of annotation errors, JavaEE 6 wins. Plus the fact that Netbeans 6.8 has what we can call native support for JavaEE 6. I need someone to convince me that I still need to Hibernate in Spring.

Merry XMas to you all.

Advertisements

Comments (3)

JavaMe Library you might need: Part 2

Following my previous post, I have a new addition to the library. This time its a Date utility. Here is the code

package com.trinisoft.mlib.util;

/**
*
* @author trinisoftinc
*/

public class Date extends java.util.Date {
public boolean isAfter(java.util.Date date) {
if(this.getTime() > date.getTime()) {
return true;
}
return false;
}

public boolean isBefore(java.util.Date date) {
if(this.getTime() < date.getTime()) {
return true;
}
return false;
}

public Date afterSeconds(int secs) {
Date newDate = this;
newDate.setTime(this.getTime() + (secs * 1000));
return newDate;
}

public Date afterMinutes(int mins) {
Date newDate = this;
newDate.setTime(this.getTime() + (mins * 60 * 1000));
return newDate;
}

public Date afterHours(int hours) {
Date newDate = this;
newDate.setTime(this.getTime() + (hours * 60 * 60 * 1000));
return newDate;
}

public Date afterDays(int days) {
Date newDate = this;
newDate.setTime(this.getTime() + (days * 24 * 60 * 60 * 1000));
return newDate;
}

public Date afterWeeks(int weeks) {
Date newDate = this;
newDate.setTime(this.getTime() + (weeks * 7 * 24 * 60 * 60 * 1000));
return newDate;
}
}

Now in your code, say you have a date object, you can do this

dateObject.isBefore(anotherDate);
Date newDate = dateObject.afterHours(24);
........

You can try it out. I also will appreciate suggestions.

Leave a Comment