• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SUGGEST: Making our own hibernate?

 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

Well I may sound little wierd but what are the requirements if one wants to have its own Hibernate i.e. use hibernate APIs and develop a simpler framework which is much lighter then Hibernate.

Please suggest if I am wrong or need some direction.
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knock yourself out - there are lots of O/R mapping tools out there besides Hibernate (e.g., Apache's OJB, Oracle's TopLink, etc.) You won't be the first, and there's always learning value in trying such a thing.

But unless you had a clear idea of how to make a more "lightweight" framework (whatever that means), I'd think carefully.

Hibernate represents a lot of accumulated expertise condensed into tens of thousands of lines of code, with about the same number of lines of test code. There is also a large user base that helps to ferret out bugs and discover improvements every day.

Unless you could improve on all this, I'd say writing your own O/R mapping tool would be a waste. I'd be reluctant to use it until you could demonstrate a clear benefit to me.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To add to what Michael already said, to "lighten" up hibernate is just a fancy way of saying remove features. Hibernate is not bloated. Everything there has a purpose. If you want something lighter than Hibernate (something with less features) I'd suggest iBatis.

As far as rolling your own, if you just want to learn how, I say go for it. If it's because you think you can make something better, I say go for it. If it's just to "lighten" it up, there are plenty of other options.
 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as rolling your own, if you just want to learn how, I say go for it. If it's because you think you can make something better, I say go for it.
Originally posted by Gregg Bolinger:

If it's just to "lighten" it up, there are plenty of other options.


How? Please suggest.

himanshu bisht
 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much for your replies.

Well I have no intentions of developing a new tool like Hibernate.What I am thinking of is simply using the API Hibernate provides and then try something which is lighter then what hibernate currently is.

What do you guys have to suggest?

Himanshu Bisht
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Himanshu Bisht:
thank you very much for your replies.

Well I have no intentions of developing a new tool like Hibernate.What I am thinking of is simply using the API Hibernate provides and then try something which is lighter then what hibernate currently is.

What do you guys have to suggest?

Himanshu Bisht


Sorry, it's still not clear to me.

Are you proposing to use Hibernate or not? Are you going to duplicate the API and insert your own implementation?

Please define "lighter". Just as an aside, I think "heavyweight" is a term that's often used against different technologies with little understanding of what it means. Like saying someone's code "isn't object-oriented" or "won't scale". It can be a catch-all ephithet in the hands of someone who doesn't understand the terms.

I think it's already been said, but you're certainly free to write your own implementation of Hibernate if you wish. You're also free to use only those features you're comfortable with until you get a firm grasp of Hibernate.

What's to suggest? Do or don't do - your choice.
 
Himanshu Bisht
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I think its my fault.I mixed up the question a bit.I will explain it again.

What I want to do is simply develop an OR mapping tool. I dont know how big the task is because I m still learning what hibernate does.What I am searching is the internal working and functionality i.e. how hibernate does it.

Is it possible to do that?( well here "possible" means short duration and less man hours)

thanks
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Himanshu Bisht:
Hi
I think its my fault.I mixed up the question a bit.I will explain it again.

What I want to do is simply develop an OR mapping tool. I dont know how big the task is because I m still learning what hibernate does.What I am searching is the internal working and functionality i.e. how hibernate does it.

Is it possible to do that?( well here "possible" means short duration and less man hours)

thanks


Short duration? No. Hibernate is a complex thing.

How well do you think you understand the problem of mapping objects to tables? How well do you know objects and relational databases?

It might sound harsh, but if you have to ask you probably don't know enough to tackle this problem.

I don't think it's possible to develop your own in less time than it'll take to learn Hibernate itself.
 
u johansson
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is Hibernate?

Is it some API you guys are stuck to?

[Removed unecessary harsh language - GDB]
[ December 27, 2005: Message edited by: Gregg Bolinger ]
 
Michael Duffy
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by u johansson:
What is Hibernate?

Is it some API you guys are stuck to?

[Removed unecessary harsh language - GDB]

[ December 27, 2005: Message edited by: Gregg Bolinger ]


Personally, I'm not that wedded to Hibernate. I think it's good, but there are other persistence technologies worth looking at, too (e.g., iBatis, JDO, etc.)

My advice would be to not try to redo something that already exists. For example, I wouldn't try to write my own servlet/JSP engine - I'd just use Tomcat. That leaves me free to solve my application problems.

The same logic applies here. It's really an argument against "Not Invented Here" syndrome.

But the OP is free to try regardless. Nobody is prohibiting the attempt.

My other statement stands, too: If you have to ask here, you probably don't know enough to make a good attempt. Gavin King certainly didn't ask a forum if he should attempt to improve on what TopLink already did.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Certainly the effort is well worth it -- it gives you a feeling for what Hibernate does and how it works. You will understand OR tools better in general if you spend time understanding how they work -- and the best way to understand how they work is to write your own.

Of course, you can then fall into the trap of thinking that yours is better because you wrote it. You will be more comforatble using yours because you understand it better, but more than likely yours is not actually better. (I've got my own OR mapping tool/system that I know in and out and use it a lot because I wrote it back in 2001 -- back before Hibernate. I won't claim mine is better, though; it does much the same things, but it is really customized to how I work. Hibernate is a much more general tool).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic