Sunday, July 20, 2008

Hibernate or JPA

Back to java. Busy time in future?

I have some works to be finished, new project what just starting for my new client and waiting for new huge projects, from few new customers. It looks I will be very, very busy.

Better solution in less time

Everyone is using hibernate for ORM, but not me. Yes I was ignoring it, since I have tried it first time 4 or even 5 years back. I always thought, why do I have to add another technology layer, introduce another dependency and make my applications dependent on technology which could not be easily removed or replaced. All my software is layered in the UI, BO and DAO layers and I never had a problem to write DAO layer classes for data manipulation with JDBC. I always felt I have more power, flexibility and options by doing it on my own.

It's still possible to write another implementation of DAO class and to have an option to replace JDBC implementation class with hibernate, but it's not as easy to do as easy to say. If you have big number of entities and relations between them, Hibernate does a lot of nice work by handling relations and lazy loading, this is a really nice feature, I like it and it's handled automatically. Problem is, once you accept features from Hibernate and start to use them, it's no way ho I can do that with JDBC. How can I make a lazy loading of linked list, I became dependent on Hibernate? The irony is, if taking hibernate road I have to change my way of thinking and application design. By doing that I'm loosing a way back, I will never be back.

The same dependency upon technology I see with spring framework. They call it Dependency Injection pattern and say that you components are loosely coupled, that's fine. But you have to be very careful, it's just amazing how fast you can be dependent on spring. The technology that is sold as a way to make you components independent makes yours application design dependent on spring. What is a difference, to have independent class and dependent application. Fine, I know there are some benefits but they can write in red "By making your classes and components independent on each other you making your application dependent on spring. And you are in danger to make yourself dependent on Spring. Please don't overuse it".

JPA may be a better choice

Lately since I moved my development to Glassfish and EJB3 I'm started to use JPA yes the same thing, but with important differences. The choice was obvious either JPA or CMB. CMB is too old, inefficient and technology dead end. JPA still new but annotation base with different implementations and it's specification based, jsr.

Why now?

I'm going to sacrifice somthing in order to get a better productivity, time spend on project development. I'm not happy how much time I spend on DAO layer. Yes the main reason is time, no less, no more just time. I hope I will get some advantages and will be able to improve time.

I still have to make some decisions where to go JPA or Hibernate. It looks that JPA could be better for me, but still have to decide.

Saturday, July 19, 2008

Busy time, a log changes

Busy time, a lot of changes

I've been quite busy last month. Had to spend some time with my family, changed my job and I'm again a freelancer. And I'm on the way to even bigger changes in my personal and professional life. I'm looking to move to new country, I'm very open with new opportunity and looking to move to any EU country or to UAE, Dubai. Where I would like to base my personal IT business. Hope some offers and decisions will come and I will be able to accept them.

Back to java. Busy time in future?

I have some works to be finished, new project what just starting for my new client and waiting for new huge projects, from few new customers. It looks I will be very, very busy.