Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

October 25, 2009

Hibernate related

Advantages :
1. Productivity : Persistence related code is very tough to write. Hibernate eliminates much of the grunt work.So we can utilize the effort we could have used in writing hand coded persistence logic.
2. Maintainability : In hand coded persistence, change in one of the object or relationship domain leads to change in other also. But hibernate provides us a buffer between the two midels, insultaing each model from minor changes in the other. Otherwise, most of the times, change needs to be made at the java side, which is thus prevented by using hibernate.
3. Performance : We can also optimize the existing hibernate code as per our requirements.Also, since hibernate provides automated persistence, it increases developer performance.
4. Vendor Independence : An ORM abstracts your application away from the underlying SQL databases and SQL dialect. If the tool supports a number of different databases, then this confers a certain level of portability on your application.

Persistence allows an object to outlice the process that created it. The state of the object may be stored to disk and an object with same state can be recreated.

problems with ORM that hibernate addresses:
1. Problem of Granularity : (Fine grained and coarse grained objects.)
2. Problem of identity : In java , identity can be defined by equals method or memory location and in DB, it is represented by primary key. Therefore,Identity should be something that should have no meaning to user.
3. Problem of association
4. Problem of subtyping
5. P of Object graph navigation.

for details refer page 10-15 chapter 1 of hibernate in action.

No comments: