By daniel
via ruby-vs-java.blogspot.com
Published: Jan 28 2007 / 19:11
I did a lot of work on our data model the past two weeks, a little with Ruby, a little with Java, and back again. I thought I should share some insights regarding the different approaches they take towards modeling your data, and their pros and cons.
Comments
ilazarte replied ago:
Pretty uninformative. I don't remember where it's said to think objects first. Maybe domain model? In the real world you can design data model to your hearts content, and then have the Hibernate plugin autogenerate your mapping files, classes, and even the wrapping daos.
next.
daniel replied ago:
Oh, I don't know. I'm working on a "real world" project right now where we had to design the entire model object layer to match the database schema, not the other way around. In fact, it really wasn't even an option to simply "generate" the schema from a set of hibernate objects.
Now, to Hibernate's credit, it probably could have been adapted to work with our schema (albiet poorly) whereas ActiveRecord would have been completely out of its league.
jwenting replied ago:
Yup, that's the real world.
In the real world the database almost always already exists and the application is being built on top of it (or else the database is filled by a process that's written in say C and designed for easy inserts and the Java application reading from it has to make do).
Systems like hibernate can still work, but you're not going to get any generation of your DDL from it.
jongretar replied ago:
Actually... People in the "real world" seem often to misundarstand "convention over configuration". I have used ActiveRecord to all sorts of "real world" projects like you call them without a problem. AR is HIGHLY configurable but it just has a lot of default settings. You can still use it like every other DBI layer. If you are using other schemas than the default ones just use AR like other db layers and use the table_name, primary_key and all those settings. I have yet to find a situation where I can't use AR.
Voters For This Link (18)
Voters Against This Link (0)