-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Should I use Hibernate in my current task?
PostPosted: Thu Jul 02, 2009 8:55 am 
Newbie

Joined: Thu Jul 02, 2009 8:16 am
Posts: 3
I am given a task to design a standalone (desktop based) client program. It basically retrieve tabular data from server, like show show all the customer info in a month.

There will be a list column view (tabular form), showing data based on the criteria: age, gender etc.

It looks to me like a table viewer for database. Should I use hibernate for this? I don't see any domain model in the design.


Thanks :)


Top
 Profile  
 
 Post subject: Re: Should I use Hibernate in my current task?
PostPosted: Thu Jul 02, 2009 8:51 pm 
Regular
Regular

Joined: Fri Jan 30, 2009 10:10 am
Posts: 74
Location: London
I wouldn't use Hibernate for this sort of application.

Hibernate can be very useful when you have a domain model, but your scenario looks more like it would be more suited for a table module (see Fowler Pattern's of Enterprise Application Architecture) approach.

Just my 2 cents.


--
Stephen Souness


Top
 Profile  
 
 Post subject: Re: Should I use Hibernate in my current task?
PostPosted: Fri Jul 03, 2009 2:31 am 
Newbie

Joined: Thu Jul 02, 2009 8:16 am
Posts: 3
Thanks Sounie!

Another question:
1. If you were to use Table Module pattern, will you still using Hibernate? I am asking this because Hibernate can run manual SQL function.

Thanks again. :)


Top
 Profile  
 
 Post subject: Re: Should I use Hibernate in my current task?
PostPosted: Fri Jul 03, 2009 4:00 am 
Regular
Regular

Joined: Fri Jan 30, 2009 10:10 am
Posts: 74
Location: London
Hi,

If you're going to be writing the queries as straight SQL, what will Hibernate offer over direct JDBC?

Maybe some query caching?

Anything else?

--
Stephen Souness


Top
 Profile  
 
 Post subject: Re: Should I use Hibernate in my current task?
PostPosted: Fri Jul 03, 2009 7:32 am 
Newbie

Joined: Thu Jul 02, 2009 8:16 am
Posts: 3
hmmm... perhaps I don't have to create/close connection with try/catch clause in every class? or perhaps it is more portable? I don't know. This is the first time I use it.


Top
 Profile  
 
 Post subject: Re: Should I use Hibernate in my current task?
PostPosted: Fri Jul 03, 2009 10:43 am 
Regular
Regular

Joined: Fri Jan 30, 2009 10:10 am
Posts: 74
Location: London
If you want something else to take care of establishing connection and ensuring resources are closed on exceptions, then there are other options.

For example, Spring provides a JDBCTemplate, see:
http://static.springsource.org/spring/docs/2.5.x/reference/jdbc.html

--
Stephen Souness


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.