• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ORM for normalization

 
Joseph Marques
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recently I came across a database developer that didn't like to normalize. I wanted to use Hibernate to create an object representation of that data, but it was extremely difficult because things were very flat. Are there any handy tricks that anyone knows of to overcome scenarios like this? Any insight would be appreciated.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your best bet may be to ditch the database developer.

If that's not possible and you can't work with him to revise the database schema, you could try creating views to provide your application with a normalized version of the data.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4014
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many times is it good in production environments to throw out normalization, such as when the performance hit of joining the tables vastly exceeds the performance hit of maintaining the denormalized structure.

As Scott said though, you can use Views and/or Triggers in a db environment to automate some of these tasks to make your data appear normalized or denormalized when it isn't.

Hibernate, like JDO, does support inheritence mappings (vertical, horizontal, flat) and if the data is as difficult to work with as you say, applying one of these patterns might help. Ultimately, if the data is too forgone for object mapping tools, then your best bet is to restructure it.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I agree completely. Sometimes normalization is not desirable.

Especially when the ratio of updates to reads is very low and join performance is an issue like in a reporting application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic